Mega Code Archive

 
Categories / MSSQL Tutorial / Transact SQL
 

Raising a message not defined in sysmessages

6> DECLARE @chrPrintMsg CHAR(255) 7>  8> RAISERROR('Undefined error raised using the WITH SETERROR option',1,2) WITH SETERROR 9> 10> SELECT @chrPrintMsg = 'Using WITH SETERROR sets the error number generated to ' + CONVERT(char,@@error) 11> PRINT @chrPrintMsg 12> GO Undefined error raised using the WITH SETERROR option Using WITH SETERROR sets the error number generated to 50000