When I run exec dbo.subprogram from SQL Server Management Studio, it executes and returns result as many rows affected.
But when I run from cmd
C:\Users\mssadmin>sqlcmd -S servername -d databasename -q "EXIT( exec dbo.subprogram)"
it returns as 0 rows affected.
What could be the problem?
dbo.subprogramaffects many rows when executed from SSMS and no rows when executed from sqlcmd? How about you post the actual code of this mysteriousdbo.subprogram. – Remus Rusanu Oct 11 '12 at 8:37