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.
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.