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

Sql ServerTsql

Sql Server Problem Overview


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)

Sql Server Solutions


Solution 1 - Sql Server

Use:

SET NOCOUNT ON

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

SET NOCOUNT OFF

Solution 2 - Sql Server

run this command:

set nocount on

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAndrew ShepherdView Question on Stackoverflow
Solution 1 - Sql Serverx2.View Answer on Stackoverflow
Solution 2 - Sql ServerAv PinzurView Answer on Stackoverflow