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 |
|
Bhavan
Starting Member
8 Posts |
Posted - 2008-02-21 : 16:13:52
|
| guys, is there way we can write a stored proc that would take minmum of 50 input IDs (numbers) and check those IDs exist or not in a table in the db. i know what to do if exist, however I am little stumbled on accpting 50 numbers as cmdline variables to the stored proc.Appareciate your help with this. Note that, I don't want to declare 50 local variables as @i1, @i2...@i50.Thanks |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-02-21 : 17:36:37
|
| you can pass them in CSV form and split them in the sproc.search for split CSV on this site and you'll get plenty of hits.another way is to pass them as xml and use built-in xml capabilities like nodes() function to transfrom the xml into a table_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-22 : 01:19:31
|
| http://www.sommarskog.se/arrays-in-sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
Bhavan
Starting Member
8 Posts |
Posted - 2008-02-22 : 16:46:20
|
| Thanks for your valuable thoughts Spirit1 & Madhivanan. Truly appreciated !. |
 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-02-23 : 12:41:14
|
| http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648Jack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
 |
|
|
|
|
|