Take the 2-minute tour ×

For a large database (thousands of stored procedures) running on a dedicated SQL Server, is it better to include SET NOCOUNT ON at the top of every stored procedure, or to set that option at the server level (Properties -> Connections -> "no count" checkbox)? It sounds like the DRY Principle ("Don't Repeat Yourself") applies, and the option should be set in just one place. If the SQL Server also hosted other databases, that would argue against setting it at the server level because other applications might depend on it. Where's the best place to SET NOCOUNT?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Make it the default for the server (which it would be except for historical reasons). I do this for all servers from the start. Ever wonder why it's SET NOCOUNT ON instead of SET COUNT OFF? It's because way way back in Sybase days the only UI was the CLI; and it was natural to show the count when a query might show no results, and therefore no indication it was complete.

share|improve this answer

Since it is a dedicated server I would set it at the server level to avoid having to add it to every stored procedure. The only issue would come up is if you wanted a stored procedure that did not have no-count.

share|improve this answer

Your Answer


