January 27, 2014 at 6:16 am
Good morning everyone. I know that this is a very dumb question, but I have a list of names stored into a @Tmp table. I want to take that list of names and then query the database using the name field as key to a record called description, and extract all of the descriptions.
Thanks.
G
January 27, 2014 at 6:23 am
Could you explain in more detail please?
"Query the database" - what table name?
"name field as key to a record called description" - are both Name and Description columns in a table?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 27, 2014 at 6:30 am
Hi. The @Tmp table has only one field called sku. I want to read sku and link it to
the record called dbo.SFC_ItemURL on dbo.SFC_ItemURL.Item = sku and extract the dbo.SFC_ItemURL.Description so that I end up with a list of sku and description. Thank you for your help.
G.
January 27, 2014 at 6:34 am
SELECT iu.Item, iu.Description
FROM dbo.SFC_ItemURL iu WHERE Item IN (SELECT t.sku FROM @Tmp t)
Edit: I broke my own rule to always qualify column names 🙁
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 27, 2014 at 6:38 am
Thanks so much, I will give that a try right now.
January 27, 2014 at 6:41 am
That worked great, thank you so very much.
G.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply