Sql Server messages

R

Robert Bull

I have a stored procedure that I run from an asp.net application that
simply backs up a very small Sql Server database. If I run the stored
procedure in Query Analyzer, there is a server message returned
letting me know that the database was backed up successfully. I want
to be able to return this message in the asp.net application for
display on the screen because it contains some other useful
information. Does anyone know how to return the server message. Thanks
in advance.

-Rob
 
S

Scott Allen

Hi Rob:

Add an event handler for the InfoMessage event on the SqlConnection
used to execute the stored procedure. The messages will arrive there
after the query completes.

HTH,
 
C

CT

In addition to Scott's reply, messages with a severity level of 19 or more,
will throw an exception in your code.
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top