What are the advantages and disadvantages of turning NOCOUNT
off in SQL server queries?
I personally like to turn NOCOUNT on for queries that get run in an manual fashion and use a lot of Print
statements to output debugging messages. In this way, your output would look less like:
Updating usernames (287 rows updated) Done Updating passwords (287 rows updated) Done Doing the next thing (1127 rows updated) Done
And more like
Updating usernames Done Updating passwords Done Doing the next thing Done
Depending on the sensitivity of what you're updating, sometimes it is helpful to include the counts; however, for complex scripts with a lot of output I usually like to leave them out.