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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to set this to be used in IN clause

Author  Topic 

Clages1
Yak Posting Veteran

69 Posts

Posted - 2008-04-10 : 15:43:02
Hi

If i do this

select * from tablex where colX in ('A','B')
works fine
but i would like to do this

declare @filter
set @filter = ' 'A', 'B' '
select * from tablex where colX in (@filter)

How can i do this?

Tks
Clages




SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-10 : 15:49:33
http://www.sommarskog.se/dynamic_sql.html



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-11 : 05:45:08
http://www.sommarskog.se/arrays-in-sql.html

Madhivanan

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

- Advertisement -