Author |
Topic |
saivyshnav
Starting Member
17 Posts |
Posted - 2006-12-06 : 03:33:34
|
Hi allHow pass multiple parameters in procedure,i.e I want a procedure that able to take record set values,that Number of record set values may be some times 1 or 5 0r 10 or moreBasical iam expecting a procedure which is to take arry type valuessaivyshnavJunior DBA |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2006-12-06 : 04:35:29
|
Hey Peter, there is a smarter way of doing it.You could use your front end script ie ASP or .net to 1st parse the values, then set them in a csv file and pass them as a single CSV value to the SP.Thats what i doEhi |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-06 : 04:56:19
|
Still any of those methods has overheads because you will first parse in front-end, then combine in CSV, then again split those values in back-end and use them. Don't use them unless you have compelling reason to do so.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2006-12-06 : 05:32:25
|
quote: Originally posted by harsh_athalye Still any of those methods has overheads because you will first parse in front-end, then combine in CSV, then again split those values in back-end and use them. Don't use them unless you have compelling reason to do so.Harsh AthalyeIndia."Nothing is Impossible"
We run an sms portal that has the ability to send one sms message to hundreds and thousands of recepients. We first parse the csv numbers and then send them to the SP for billing. We run a timer on the script. And have never one day run into error or over shot our bandwidth resources.At times we have up to 400,000 messages sent in a day. And growing.Ehi |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2006-12-06 : 05:38:06
|
...And we have been running this for 3 years now |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-06 : 05:40:28
|
May be because you are passing numbers in CSV, but it's a different case when you need to pass an entire recordset as a CSV.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2006-12-06 : 05:54:18
|
Ok, but i think its a very efficient method. At times, we blast dynamic sms messages which are sent out one by one in a loop in the script. Each loop is restricted to a maximum of 500 loops. And its still very efficientEhi |
 |
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2006-12-06 : 08:38:07
|
XML typed parameter might work better than a CSV.Jayto here knows when |
 |
|
saivyshnav
Starting Member
17 Posts |
Posted - 2006-12-06 : 08:46:43
|
Hi Peso,afrika,harsh_athalye,Page47Thanks for all help...saivyshnavJunior DBA |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2006-12-06 : 10:55:59
|
quote: Originally posted by Page47 XML typed parameter might work better than a CSV.Jayto here knows when
Could you shed a bit more light on this ? |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-06 : 11:01:07
|
It's there in the link Peter gave:[url]http://www.sommarskog.se/arrays-in-sql.html#OPENXML[/url]Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2006-12-06 : 13:28:34
|
I dunno ... something likecreate proc test @xml xmlasselect d.*from sys.databases d cross apply @xml.nodes('/root/a') x(a)where x.a.value('./@v', 'int') = database_idgodeclare @xml xmlselect @xml = '<root><a v="4"></a><a v="7"></a></root>'exec test @xml Jayto here knows when |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2006-12-06 : 15:58:53
|
Ok, thanks, however i hear XML in sql server is not too reliable.Afrika |
 |
|
|