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.
Author |
Topic |
marsh_1st
Starting Member
1 Post |
Posted - 2007-05-23 : 07:16:02
|
I am new to this forum but i have a probably very simple question.My senerio is this. The user will call an sp with an unknown number of arguments so i have decided to make this a single argument which is a concatination of all the arguments eg. "'cat', 'dog', 'cow'". Is there a simple way of getting this string passed as code inside an IN or similar. So, for example, the above string is called @variable. Is there a way of doing something like ..... IN (SELECT @variable) such that it is equivalent to ...... IN ('cat', 'dog', 'cow')Any help would be appreciated |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
PeterNeo
Constraint Violating Yak Guru
357 Posts |
Posted - 2007-05-23 : 08:10:39
|
Hi,if u r table is small, then u can try something likeselect * from tblname where ',' + @variable + ',' like '%,' + colname + ',%'else use splitfunction, which u can search in this forum. |
 |
|
|
|
|