Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Shilpa22
Starting Member
37 Posts |
Posted - 2010-05-21 : 12:55:06
|
| Hello All,I need to pass list of values to a select statemnt(IN query)I am generating CSV values as belowCREATE TABLE #temp1 ( QueueName varchar(500) )INSERT INTO #temp1select Queue_ID from dws..dws_queue where performance_group_id =4declare @tmp varchar(500) declare @csv varchar(500) SET @tmp = '' select @tmp = @tmp + QueueName + ', ' from #temp1 set @csv = (select SUBSTRING(@tmp, 0, LEN(@tmp)))print @csv drop table #temp1 By this I am getting the values as 'aa,bb,cc'. returning value is varchar.But i want the values as ('aa','bb','cc') to pass them in IN(list).Please help me out Thanks,SilpaThanks in AdvanceShilpa |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-05-21 : 13:22:05
|
| Have a look at below link. It will be of help to you.http://www.sommarskog.se/arrays-in-sql-2005.html |
 |
|
|
|
|
|