A severe error occurred on the current command

G

Guest

I'm getting this error message:

A severe error occurred on the current command. The results, if any, should
be discarded.

I am using 2 SQL Servers A and B. Server B is a linked server on Server A.
I am using ADO.NET to run a stored proc on Server A that calls another stored
proc on Server B. The error is caused because there PRINT statements in the
proc on Server B (you can replicate this for yourself).

I do not have access to Server B and so can't get the PRINT statements taken
out. Does anyone know a work around for this. It's definitely a bug, but I
can't find any information on it anywhere.

Any help appreciated
 
M

Mary Chipman

Print statements shouldn't be causing a problem. I'd recommend putting
a Profiler trace on the application and examining the calls. It would
be impossible for an outsider to help you debug this without access to
the client and stored procedure code.

--Mary
 
G

Guest

Print statements shouldn't cause the problem, but they do. I have put
together a sample application to prove this, but there is far too much code
to post here. Try it for yourself using a a linked SQL Server and stored
procs. I am using the SQLHelper dll code provided on asp.net to make my
procedure calls.

Taking the PRINT statements out stops the error occuring.
 
M

Mary Chipman

Another frequently overlooked cause of problems on the client is not
having SET NOCOUNT ON as the first line of your stored procedure code.
If you can't find it in the documentation or a KB article, a google
groups search on an issue is a good way to gain a broader sampling and
can be helpful in determining whether something really is a bug or
not. If others have had the same problem and found the same answer,
you'll see it show up there.

--Mary
 
G

Guest

Far too much code? If you can't reproduce the problem in 4-5 lines of code,
then you aren't close to a solution

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top