I read that it's advisable to use SET NOCOUNT ON at the beginning of a stored procedure. If you do so, is it really necessary to SET NOCOUNT OFF at the end of the stored procedure? I wonder what's the point of doing SET NOCOUNT OFF when the stored procedure is already ending anyway? What happens if you don't SET NOCOUNT OFF?
OK, a related question: I am invoking a bunch of stored procedures from a Visual Basic program. If the first stored procedure invoked has SET NOCOUNT ON and does not set it off upon exiting, will the remaining stored procedures inherit the NOCOUNT ON setting so they do not have to individually set it on? Or is the NOCOUNT ON setting automatically reset to the default OFF when the first stored procedure exits? (Note: The connection remains open and is never closed at any time during all of this.)
OK, a related question: I am invoking a bunch of stored procedures from a Visual Basic program. If the first stored procedure invoked has SET NOCOUNT ON and does not set it off upon exiting, will the remaining stored procedures inherit the NOCOUNT ON setting so they do not have to individually set it on? Or is the NOCOUNT ON setting automatically reset to the default OFF when the first stored procedure exits? (Note: The connection remains open and is never closed at any time during all of this.)
Thanks!
Every stored procedure needs SET NOCOUNT ON as they do not inherit the setting from other objects.