| Author |
Topic |
|
overthetop
Starting Member
18 Posts |
Posted - 2006-09-26 : 08:57:31
|
Hi,I need to pass an unknown count params to a store procedure. Is there a way to do that? I'm thinking of using delimited list and parse it in the sp but is this the most appropriate way 10x |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-26 : 09:02:10
|
| If you do not know the number of parameters, this is one of the ways to go. An other approach can be using XML.But why do you not know the number of params?Peter LarssonHelsingborg, Sweden |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-09-26 : 10:25:42
|
sounds like a search criteria SP. [Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
overthetop
Starting Member
18 Posts |
Posted - 2006-09-26 : 14:11:10
|
| It's something like deleting an unknown count of users, because the applications passes the usernames to the sp. Peso can you give me a link to read more about doing this with xml? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-26 : 14:19:06
|
| I think it is better to call the delete stored procedure many times, with one name at a time.Peter LarssonHelsingborg, Sweden |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-09-26 : 14:31:50
|
"I think it is better to call the delete stored procedure many times, with one name at a time"Hmmmm .... take a while though ...DELETE DFROM MyTable AS D JOIN dbo.CSV_Splitter(@strListOfNames) AS LIST ON D.UserName = LIST.Value would be quicker ...Kristen |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Kristen
Test
22859 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-27 : 00:47:37
|
| I didn't think of what was faster. I was disturbed that records are deleted with names, not primary keys.Peter LarssonHelsingborg, Sweden |
 |
|
|
|