in reply to MS SQL and "Connection is busy with results for another hstmt"

SET NOCOUNT ON -- this is what I had to add
You were hit by multiple result sets being returned from the stored procedure, probably from the select @Country ... statement, even though that select doesn't actually return any data to the client.

The NOCOUNT option, when turned on, stops the server returning the "number of rows affected" information, and this is probably what is causing the "multiple result sets" in your code.

Michael

  • Comment on Re: MS SQL and "Connection is busy with results for another hstmt"
  • Download Code