Using SQL2K SP4, I'm getting a weird error when I run a stored
procedure from a remote server:
exec remoteserver.database.dbo.proc
returns:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any,
should be discarded.
Googling around, I did find a reference to the 'set nocount on'
command as a fix for this. Sure enough, when a add the clause above
the exec statement, the error goes away.
The thing is, set nocount on is already in the procedure, so this
shouldn't happen. Or so I thought. The data does return, but I and
our monitoring tools do not like to see "severe error" messages.
Any ideas as to what is going on? As this is 2K, and not 2005, I
don't think kb928372 applies.
TIA.
Erland Sommarskog - 27 Aug 2007 23:14 GMT
> Using SQL2K SP4, I'm getting a weird error when I run a stored
> procedure from a remote server:
[quoted text clipped - 17 lines]
> Any ideas as to what is going on? As this is 2K, and not 2005, I
> don't think kb928372 applies.
What happens if you run the batch from Query Analyzer or SQLCMD?
I ask, because it may be an error in SqlClient, and QA and SQLCMD
use ODBC and OLE DB respectively. On the other hand, if they also
say weird things, then it's some bug in SQL Server. You could also
examine the SQL Server error log for stack dumps.
The fact that SET NOCOUNT ON helps is not so strange. You may have
SET NOCOUNT ON in the remote procedure, but that does not affect the
local session.

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx