This page is old and the replies are old. But, the best answer has not been upvoted to the top. I suppose it is because not enough explanation was provided.
Use the NOCOUNT setting. Everyone should look at the NOCOUNT setting. The default setting is OFF.
Changing the default setting of a this universally even on a new database may cause confusion for some coders\users. I recommend using the approach of capturing the setting before changing it, then setting it back. This is shown in the example script below which demonstrates use of the NOCOUNT setting.
Here is a good article.
https://www.sqlshack.com/set-nocount-on-statement-usage-and-performance-benefits-in-sql-server/
DROP TABLE IF EXISTS TestTable
GO
CREATE TABLE TestTable (ID INT, TestText VARCHAR (40))
GO
-- Get the Original NOCOUNT setting and save it to @OriginalNoCountSettingIsOn
DECLARE @options INT
SET @options = @@OPTIONS
DECLARE @OriginalNoCountSettingIsOn AS bit
SET @OriginalNoCountSettingIsOn = IIF(( (512 & @@OPTIONS) = 512 ),1,0)
-- Now set NOCOUNT ON to suppress result output returned from INSERTS
-- Note - this does not affect @@ROWCOUNT values from being set
SET NOCOUNT ON -- <---- Try running script with SET NOCOUNT ON and SET NOCOUNT OFF to See difference
INSERT INTO TestTable (ID, TestText)
VALUES (0, 'Test Row 1')
INSERT INTO TestTable (ID, TestText)
VALUES (0, 'Test Row 2'),
(0, 'Test Row 3'),
(0, 'Test Row 4')
INSERT INTO TestTable (ID, TestText)
VALUES (0, 'Test Row 5')
/*Now set NOCOUNT back to original setting*/
IF @OriginalNoCountSettingIsOn = 1
BEGIN
SET NOCOUNT ON
END
ELSE
BEGIN
SET NOCOUNT OFF
END
DROP TABLE IF EXISTS TestTable
GO