This is what happens. A stored procedure contains several steps. When it is run from the SQL Server management studio, it is easy to see how each step leads to a separate message, for example "(3 row(s) affected)", and only the last step triggers a response.
-, pyodbc resultset, , , , fetchall().
, nextset(), , , :
while cursor.nextset():
try:
results = cursor.fetchall()
break
except pyodbc.ProgrammingError:
continue
, , SET NOCOUNT ON;, , , , (# rows affected) . proc, :
cursor.execute("set nocount on; exec MyStoredProc ?", some_parameter)
results = cursor.fetchall()