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
?
views:
543answers:
2
+1
A:
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.
Jeremy Reagan
2009-01-19 18:07:47
A:
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.
le dorfier
2009-01-19 18:20:14