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
 Transact-SQL (2000)
 Dynamic SQL Query

Author  Topic 

harrisw48
Starting Member

34 Posts

Posted - 2007-02-27 : 06:40:14
Im having trouble doing an in using dynamic sql

The variable @criteria holds '22','3'

The where in the sql query is

and [fieldname] in ( '''+ @criteria + ''')

What format should the above criteria be so that it treats it as an IN statement?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-27 : 06:42:04
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=79509


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-02-28 : 00:05:53
http://www.sommarskog.se/dynamic_sql.html


www.elsasoft.org
Go to Top of Page
   

- Advertisement -