Hi
The left outer joing should show the items in ar even though there is no
entry in arb. Could you please post ddl and example data (see
http://www.aspfaq.com/etiquette.asp?id=5006 ) as well as SQL Server
version.
John
"Matt" <matt@fruitsalad.org> wrote in message
news:b609190f.0409250018.309f7157@posting.google.c om...[color=blue]
> Hello
>
> I have to tables ar and arb, ar holds articles and a swedish
> description, arb holds descriptions in other languages.
>
> I want to retreive all articles that match a criteria from ar and also
> display their corresponding entries in arb, but if there is NO entry
> in arb I still want it to show up as NULL or something, so that I can
> get the attention that there IS no language associated with that
> article.
>
> I tried to use the following but it does not work correctly
>
> create procedure q_spr_languagecheckpervg
> @varugruppkod varchar(20),
> @sprakkod int
>
> AS
>
>
> select ar.artnr,
> ar.artbeskr,
> arb.artbeskr AS 'sprak'
> into ##q_tbl_languagecheckpervg
> from ar LEFT OUTER JOIN arb ON ar.artnr = arb.artnr
> where ar.varugruppkod = @varugruppkod and
> arb.sprakkod = @sprakkod
>
> exec ('master..xp_cmdshell "bcp ##q_tbl_languagecheckpervg out
> c:\outpath\adhoc\'+@varugruppkod+'.xls -Usa -P13hla -c -C"')
>
> drop table ##q_tbl_languagecheckpervg
>
>
> The problem being that if an article has NO entry in arb it will not
> be shown at all.
>
> rgds
> Matt[/color]