Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error info on null values

Status
Not open for further replies.

giovi2002

Programmer
Aug 22, 2005
47
NL
Goal: pass error messages to adp client when a field has a null value
How: I've been using a trigger to validate one or more fields have been left blank in my table. Then i've sql server passing an error by using the raiserror command. But the problem is: the message isn't shown .

If afield IS NULL
Begin
raiserror('you've left the A field blank',16,1)
End

Of course I've set the fields to 'not nullable' the ununderstandable message caused by the not nullable might be the cause my raiserror isn't shown. Maybe I can trap the not nullable error and transform it into a more comprehensible format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top