Reputation: 9660
I am using Sql Server 2008. My Stored Procedure accepts almost 150 parameters. Is there anything wrong with that performance-wise?
Upvotes: 2
Views: 3592
Reputation: 57023
Regulars in the SQL Server newsgroups will be familiar with the many quarrels between Joe Celko and Tony Rogerson and one of them is on the very subject of whether it is a good idea to use a stored procedure with a large number of parameters.
Because the question is specifically about performance, here's Tony side of the argument:
Don't use CSV/XML - use 1,000 Parameters instead!
Tony Rogerson is a fellow Brit (US = limey) and the title is ironic (US = NULL).
Upvotes: 1
Reputation: 161773
You should definitely identify the reasons for all the parameters.
Upvotes: 0
Reputation: 65381
Maybe it is not a problem from a performance perspective. But from a maintenance perspective.
You could consider sending the data as a single xml parameter. For details see:
http://msdn.microsoft.com/en-us/library/dd788497.aspx
Upvotes: 5
Reputation: 74250
Nothing wrong performance wise but it smells as something that could be better done with dynamic SQL. Hard to tell without seeing the code.
Upvotes: 3
Reputation: 3901
when you are using SQL Server 2008 you can use the new Table parameter. If the parameters are the same, you can easily use the table parameter.
Here is link to the MSDN. Here is another link, a bit more explained
Enjoy.
Upvotes: 6