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 - 2004-03-12 : 08:23:42
|
| Kumar writes "To a stored procedure, I want to pass a variable number of parameters. That is, sometimes I would like to send only 2 parameters, sometimes 5 parameters, sometimes 3 parameters etc... The total number of parameters are not fixed.Is this possible? If yes, can anyone please let me know how is this possible" |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-03-12 : 08:28:14
|
| Why? What are you going to do with the variables? Is there a max number? Tell us what the purpose is and we can probably help you more.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2004-03-12 : 08:30:52
|
| You can pass multiple values as a comma-separated value (CSV) string, and parse them inside your stored procedure. These articles should help:http://www.sqlteam.com/searchresults.asp?SearchTerms=csvBut as Derrick suggested, we need to know more about what you're trying to do before we can offer a real solution. |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
|
|
|
|
|