Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to set this to be used in IN clause
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

69 Posts

Posted - 04/10/2008 :  15:43:02  Show Profile  Reply with Quote

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?


Patron Saint of Lost Yaks

30421 Posts

Posted - 04/10/2008 :  15:49:33  Show Profile  Visit SwePeso's Homepage  Reply with Quote

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

Premature Yak Congratulator

22864 Posts

Posted - 04/11/2008 :  05:45:08  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000