November 2, 2005 at 11:36 am
Hi all. I had seen an article a while back showing how to return the contents of a column in the results of a query into a variable (like varchar). I can not seem to find that example again, and I really need to use it.
Any ideas?
Thanks.
Jeff
November 2, 2005 at 11:51 am
I do not recall this, What are you trying to do?
Declare @String varchar(8000)
set @String = ''
Select @String = @String + mycolumn + ','
from Mytable
Something like this?
November 2, 2005 at 11:52 am
Like this?
SET @MyVar = (Select name from Employees where EmpID = @EmpID)
November 2, 2005 at 11:54 am
Ray,
That's what I was looking for.
Thanks!
Jeff
November 2, 2005 at 11:59 am
Next time you search, try the keyword concatenation. It should give you all the answers you need.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply