Error messages from SQL Server

R

Ray

Hi,
I intentionally modified a stored proc to raise an error
and this is the message in Query Analyzer when I run the
sp:
Server: Msg 8152, Level 16, State 9, Procedure MyTest,
Line 5
String or binary data would be truncated.
The statement has been terminated.
Server: Msg 50000, Level 16, State 1, Procedure test, Line
8
Unknown Product ID: abc

As you can see there are 3 error messages (last one is
raised by RaisError function). The only one I can identify
from my vb.net app via sqlException is: "String or binary
data would be truncated."
My question is how to view the rest of messages via VB.NET.
Tia,
Ray
 
R

Ravikanth[MVP]

Hi

declare a OUTPUT parameter and assign you message to
OUTPUT Parameter.

From VB.NET check OUTPUT Parameter.

HTH
Ravikanth[MVP]
 

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