I am trying to trap an conversion error arising from running the following update against 'myField' which is a decimal.
However, rather than continue into my trap the transaction breaks and returns the standard error message
Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.
Naturally, I'm being an idiot but just what have I forgotten over the past six months!??!
DECLARE @ErrorExit INT
SET @ErrorExit = 0
begin transaction
UPdate DTS_Imports set myField = 'DontLikeText'
IF @@ERROR <> 0
begin
ROLLBACK Transaction
RAISERROR
('Process Failed',
16, 1)
end
Commit Transaction
go
Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.
However, rather than continue into my trap the transaction breaks and returns the standard error message
Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.
Naturally, I'm being an idiot but just what have I forgotten over the past six months!??!
DECLARE @ErrorExit INT
SET @ErrorExit = 0
begin transaction
UPdate DTS_Imports set myField = 'DontLikeText'
IF @@ERROR <> 0
begin
ROLLBACK Transaction
RAISERROR
('Process Failed',
16, 1)
end
Commit Transaction
go
Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.