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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-05 : 07:21:50
|
| Kavita writes "How can I pass an input list of strings to the stored proc? The below is NOT working for me...If you can answer this question, I would be grateful to you.CREATE PROCEDURE MyProc @NameList varchar(500) AS BEGINSET NOCOUNT ONSELECT MyName from MyTable where MyName in (@NameList)ENDGo" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-05 : 07:33:48
|
| One of the ways is to use Dynamic SQLExec('SELECT MyName from MyTable where MyName in ('+@NameList+')')MadhivananFailing to plan is Planning to fail |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-10-05 : 10:11:39
|
hey Kristen, another sticky topic for you...located at the newbie forum ways:1. use charindex or patindex to check the pattern 2. use a function that will split the text you provided --------------------keeping it simple... |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-10-05 : 13:40:27
|
| "another sticky topic for you"I've got one "SLECT * FROM MyTable WHERE MyColumn IN @CSV" in there, but I don't think that thread is very good - doesn't cover SPLIT etc. I could do with a 10-out-of-10 thread to link toKristen |
 |
|
|
|
|
|