SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
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
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Clages1
Yak Posting Veteran

67 Posts

Posted - 04/10/2008 :  15:43:02  Show Profile  Reply with Quote
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

Sweden
30178 Posts

Posted - 04/10/2008 :  15:49:33  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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

India
22754 Posts

Posted - 04/11/2008 :  05:45:08  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
http://www.sommarskog.se/arrays-in-sql.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.08 seconds. Powered By: Snitz Forums 2000