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 an Equivalent of Oracle's SQLERRM in SQL Server 7?

Status
Not open for further replies.

Smorton

Programmer
Oct 15, 2001
2
US
Hi all, here is my dilema. I am converting an Oracle database into SQL Server 7. In Oracle, when I receive an error message I capture it by sticking it into a variable. Example: v_ErrorText := substr(sqlerrm, 1, 200);

I stick that error text into a separate table called TERRORLOG which has the name of the user, date, and my own description of the error as well.

I have not found a way to do this in SQL Server. So far I have been using @@ERROR but this only gives me the error number to put into my table. How can I also get the system messages associated with this error? I do not want to go to the master.dbo.sysmessages table every time to look up the error. I would like to have that error text placed into my table with the error number. Any help is appreciated! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top