When SET NOCOUNT ON, the count is not returned. While SET NOCOUNT OFF, the count is returned. The @@ROWCOUNT function is updated even when SET NOCOUNT is ON.
Example,
– SET NOCOUNT to ON to no longer display the count message.
SET NOCOUNT ON;
GO
SELECT TOP(5) product
FROM dbo.test
WHERE producy LIKE ‘A%’;
GO
Tags: Transact-SQL