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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CSV String

Author  Topic 

mahimam_2004
Starting Member

40 Posts

Posted - 2006-12-15 : 11:22:19
Now Iam using the @State in IN clause
Like select ID from Organization where Name IN(@State)
But it is not producing the result.Why?How to use the @state in 'IN'

mahimam_2004
Starting Member

40 Posts

Posted - 2006-12-15 : 11:24:05
Hi,
In the above @state is coming from the following statement

declare @state varchar(100),@st varchar(100)
set @state='NY,VA,AL,CA'

--select REPLACE ( @state , ',' , ''',''' )

select @state=''''+REPLACE ( @state , ',' , ''',''' )+''''
print @st

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-15 : 11:29:03
It is because you didnt read my first reply in this tpoic
http://sqlteam.com/forums/topic.asp?TOPIC_ID=76428

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -