views:

449

answers:

4

How many OUTPUT parameters can we declare for a stored procedure in SQL Server ?

+2  A: 

Basically almost as many as you like ;-)

If you check this Technet article Maximum Capacity Specifications for SQL Server, the maximum number of parameters for a stored procedure is 2'100. I don't see any mention whether or not you couldn't have all 2100 being output parameters, if you really must......

marc_s
+1  A: 

2100 as per MSDN documentation.

Mark
+1  A: 

You're only limited by the number of parameters a stored procedure can have which is 2100 (SQL 2005/2008).

From MSDN:

A stored procedure can have a maximum of 2,100 parameters

AdaTheDev
+2  A: 

According to MSDN, a stored procedure can have a maximum of 2,100 parameters. The limit applies across all parameters, regardless of their direction (input or output).

However, I would advice you to keep the number of parameters relatively low. If you're returning many pieces of data or a lot of data, consider using a result set instead.

Håvard S