Reputation: 31875
There is a stored procedure that we're trying to increase the performance of... at this point we're looking for non-intrusive 'fixes'.
This sproc gets called about 500,000 times a day - and it can call into up to 50 other stored procedures below. - DON'T ASK
Is there a way to SET NOCOUNT ON
at the top of one sproc, and have it propagate down into all sprocs and statements below?
EDIT: Judging by the first two answers below - that leaves me to ask... is there a way to set the "user option" in the connection string or something so that it works for one 'user'? - any kind of 'secret tip' like this would be great.
Upvotes: 5
Views: 1979
Reputation: 135888
The scope of SET NOCOUNT ON
is to the current object only. There's no way to extend the scope beyond that.
Upvotes: 3
Reputation: 33183
The short answer is no this is not possible to propogate it. You have to explicitly say:
SET NOCOUNT ON
A global change can be made based on the answer by @user92546 but I am always a bit wary about global changes. The minute you need it you realize that a global change was made...Proceed with caution :).
Upvotes: 4