Mega Code Archive

 
Categories / MSSQL Tutorial / Transact SQL
 

Raise exception with parameters

6> DECLARE @ProductId INT 7> SET @ProductId = 100 8> 9> 10> RAISERROR('Problem with ProductId %i', 16, 1, @ProductId) 11> GO Msg 50000, Level 16, State 1, Server J\SQLEXPRESS, Line 10 Problem with ProductId 100 1>