June 2008
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
Search

 
Catagories
Archives
Recent Entries
Links
RSS
stored procedure parameters
Catagory: sql server · This Entry · Comment(0) · eMail entry · Google
June 10, 2004 05:27 PM

sql server

i actualy forgot you can do this (got used to stuffing paramters in order!)...

you can explicitly name your parameters inline (in the TSQL exec string).


EXEC SampleProcedure @EmployeeIDParm = 9, @MaxQuantity = @MaxQtyVariable OUTPUT

with the return code...

EXEC @ReturnCode = SampleProcedure @EmployeeIDParm = 9, @MaxQuantity = @MaxQtyVariable OUTPUT

let's you get away from order dependent parameters, letting you override just one if all the others have defaults etc.

probably why .net ado functions have you specify the input vars by name each time, including the @ symbol reference. it just builds the exec string up internally using that form.





Comments

Post a comment
Name:


Email Address:


URL:


Comments: