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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there any way in a stored proced

Status
Not open for further replies.

LokiDba

Programmer
Dec 13, 2000
63
GB
Is there any way in a stored procedure to catch a system
error message ie Column cannot be null and replace it with
a friendly error message.

Thanks in Advance


LokiDBA
 
Yes.

Use the @@error object to check for errors after your insert\update code. if @@error <> 0 then an error has occured, you can return a message to the user to tell them the Insert\update has failed.

See SQL server books online for more info on @@error.

Andy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top