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
 Transact-SQL (2000)
 To catch string errors in SQL

Author  Topic 

jugo
Starting Member

4 Posts

Posted - 2004-11-02 : 06:07:47
How i can catch error string that server returns?
Not to get just error number and to see from sysmessages in master DB but to get whole string.

Example:
error:
547

in sysmesages:
"%ls statement conflicted with %ls %ls constraint '%.*ls'. The conflict occurred in database '%.*ls', table '%.*ls'%ls%.*ls%ls."

whole error string:
"DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_Ishod_na_Bolesta_Dijagnoza'. The conflict occurred in database 'Ordinacija2004', table 'Ishod_na_Bolesta', column 'Dijagnoza_ID'.
The statement has been terminated."

nr
SQLTeam MVY

12543 Posts

Posted - 2004-11-02 : 06:45:24
In the client or
http://www.nigelrivett.net/spFormatOutputBuffer.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -