When running code, SSMS 2012 is writing (1 row(s) affected)
into the messages window for every line in mydataset. This isn't unexpected (see details below) but is there any way to suppress these messages, while still getting important error messages?
I am executing code that uses a cursor to WHILE loop through a table and do some rather complex comparisons to prior records and manipulations, then collect the results in a @Temp table before writing it out to the database:
WHILE @@FETCH_STATUS = 0
BEGIN
--do stuff here, then collect the results
INSERT @Temptable(value)
SELECT @value;
FETCH NEXT FROM c INTO @value
END
SSMS 2012 writes (1 row(s) affected)
into the messages window for every INSERT
, which makes sense, but is annoying in this case, and since I'm on a lousy VPN where bandwidth is precious, the chattering back and forth has some impact.
Put SET NOCOUNT ON;
at the beginning of your script, or wherever you want to begin suppressing the "x rows affected" messages. To resume seeing them later in the script (if desired), put in SET NOCOUNT OFF;