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