Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Error message retrieval

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-03-24 : 07:46:45
Riaz writes "HI

When an error occurs in a stored proc the error number can be retrieved using @@error, however, I would like to retrieve the error message so I can store it in a database table and continue processing with out having to exit the proc each time the error occurs. How can I retrieve the error message?

Thanks for your help

Riaz"

samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2003-03-24 : 09:08:27
create table test1 (A int)
go
insert into test1 values ('agdaga')
go
select * from master.dbo.sysmessages where error=@@error

Sekar
~~~~
Success is not a destination that you ever reach. Success is the quality of your journey.
Go to Top of Page
   

- Advertisement -