I am calling stored procedure using SQLCMD which will insert data into multiple tables. And output of that procedure is captured in log file using -o. But, i can't see Row(s) affected any where in the log file. And same when I am executing procedure I am getting Row(s) affected.

Is there any other way to print Row(s) affected in log file along with print statement. I have tried using SET NOCOUNT OFF as well but no use.

  • Have you tried -Q "SET NOCOUNT OFF;EXEC YourProcedure" – Scott Hodgin Nov 3 '16 at 9:42
  • Yes i tried with that too. Still i am not getting. – Syed Yunus Nov 3 '16 at 13:07

I'm not sure if this is your problem, but check your 'Connections' options for your Sql Server instance.

Using Sql Server Management Studio, right-click your instance and select 'Properties'. Then select 'Connections'. Under 'Default connection options', scroll down and make sure that 'no count' is NOT checked.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.