SQL Server RAISERROR messages

T

TomT

I could be wrong, but I thought if I used RAISERROR in stored procedure, it
would return the error message back to the client, in this case MS Access
(2003).

However, altho I see the message displayed when I debug the stored proc, it
is not returned to the MS Access client that called the procedure via ado.

Am I missing something?

Thanks
 
M

Michael Cheng [MSFT]

Hi Tom,

Thanks for your post.

Please refer the Knowledge Base article below for more information about
how to retrieve values in SQL Server stored procedures with ADO.

How To Retrieve Values in SQL Server Stored Procedures with ADO
http://support.microsoft.com/kb/Q194792


Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

TomT

Michael,

Hi. Thanks for your response. I am familiar with what you refer to, but was
curious as to why RAISERROR doesn't return any error message at all to the
client. There is nothing at all to indicate the error to the client from SQL
Server - e.g. in the sp if a certain statement fails to meet my criteria, I
insert a RAISERROR statement, followed by RETURN 1. However, nothing comes
back to the client at all to indicate an error. The client process completes
with no message.

Is this what is supposed to happen?

Thanks,

Tom
 
M

Michael Cheng [MSFT]

Hi Tom,

Based on my knowledge, RAISERROR will return a user-defined error message
and sets a system flag to record that an error has occurred. Using
RAISERROR, the client can either retrieve an entry from the sysmessages
table or build a message dynamically with user-specified severity and state
information. After the message is defined it is sent back to the client as
a server error message.

I followed KB Q194792 and it will return the defined error message
"RAISERROR.PError1" if the parameters are wrong.

If I didn't understand you clearly, would you please generate a small
sample access application file and stored procedure? My direct email
address is (e-mail address removed)(remember to remove "online" before
you click SEND), you may send the file to me directly and I will keep
secure.


Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Michael Cheng [MSFT]

Hi Tom,

I am currently standing by for an update from you and would like to know
how things are going there. Should you have any samples available sending
to me? Please don't hesitate to let me know directly. It's my pleasure to
be of assistance!


Sincerely yours,

Michael Cheng
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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