Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SET NOCOUNT ON

Status
Not open for further replies.

Cheryl3D

Programmer
Mar 26, 2002
116
US
I want to know if you SET NOCOUNT ON in a stored procedure or view, do you have to SET NOCOUNT OFF later in the stored procedure? Or is it optional? Just SET NOCOUNT ON at beginning, perform SQL task, then end it. Which is correct?

Thanks,
Cheryl
 
The normal is to have

SET NOCOUNT ON

at the begining of a procedure. This means that messages telling how many rows that were affected by a delete/insert/update query will not be sent. There is no need to set nocount off and I don't see any connection to views.
 
Thanks swampBoogie:

Sorry, I added views but you are correct, views don't apply to this SET NOCOUNT ON situation.

Cheryl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top