How to stop SQLServer writing extraneous stuff eg (1 rows affected)

sql-server, t-sql

Solution

Use:

SET NOCOUNT ON

to suppress these messages and use the command below to enable the messages.

SET NOCOUNT OFF

Problem

Is there a command I can run inside my SQL script so that it stops outputing information about each operation that gets run? ie I don't want to see this: ``` (1 row(s) affected) (1 row(s) affected) (1 row(s) affected) ```

Original source