connection-level exception : ERROR « System Settings « SQL Server / T-SQL Tutorial






6> CREATE PROCEDURE ConversionException
7> AS
8> BEGIN
9>     SELECT CONVERT(INT, 'abc')
10> END
11> GO
1>
2>
3> EXEC ConversionException
4> PRINT 'This will NOT print!'
5> GO
Msg 245, Level 16, State 1, Server J\SQLEXPRESS, Procedure ConversionException, Line 9
Conversion failed when converting the varchar value 'abc' to data type int.
1>
2> drop PROCEDURE ConversionException;
3> GO








26.6.ERROR
26.6.1.@@error is
26.6.2.Using @@ERROR
26.6.3.@@ERROR reset
26.6.4.SELECT 5 / 0
26.6.5.SELECT * FROM master.dbo.sysmessages WHERE error = @@ERROR
26.6.6.Attempt to Capture @@IDENTITY, @@ROWCOUNT, and @@ERROR
26.6.7.Parse exception
26.6.8.connection-level exception
26.6.9.Check the @@ERROR with if statement
26.6.10.A stored procedure that uses the @@ERROR system function
26.6.11.Observing line numbers in exceptions