RAISERROR (50001, 15, -1, @parm1, @parm2) : RAISERROR « Transact SQL « SQL Server / T-SQL Tutorial






28> DECLARE @parm1 varchar(30), @parm2 int
29> SELECT @parm1=USER_NAME(), @parm2=@@spid
30> RAISERROR (50001, 15, -1, @parm1, @parm2)
31> GO
Msg 50001, Level 15, State 1, Server J\SQLEXPRESS, Line 30
The specified value for dbo was invalid.
1>








20.21.RAISERROR
20.21.1.RAISERROR syntax
20.21.2.Using RAISERROR without an Error Number
20.21.3.RAISERROR (50001, 15, -1, @parm1, @parm2)
20.21.4.Raise exception with parameters
20.21.5.The syntax of the RAISERROR statement: RAISERROR ({message_id|message_string}, severity, state [, argument]...)
20.21.6.Raising a message not defined in sysmessages.
20.21.7.Raise error out of a procedure
20.21.8.Raise error in case of error
20.21.9.Using RAISERROR with the SETERROR Option