I’ve disabled row counting using SET NOCOUNT ON but it seems that sqlserver is still counting rows.
USE Northwind
SET NOCOUNT ON;
SELECT * FROM Products p
SELECT @@ROWCOUNT AS 'RowCount';
the query returns 77 for row count, why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SET NOCOUNT ON;
prevents the rowcount from being returned when you execute your stored procedure. It has no affect on @@rowcount.
see http://msdn.microsoft.com/en-us/library/ms189837.aspx for specific info