April 17, 2012 at 9:04 am
Someone can help me please
IF OBJECT_ID ('dbo.Send_decaissements','TR') IS NOT NULL
DROP TRIGGER dbo.Send_decaissements;
GO
CREATE TRIGGER Send_decaissements
ON dbo.DECAISSEMENTS_SGXP
FOR INSERT
AS
declare @srvr nvarchar(128),@retval int
set @srvr ='LK_SGSOL_SGXP'
begin try
exec @retval = sys.sp_testlinkedserver @srvr
end try
begin catch
set @retval = sign(@@Error)
end catch
if @retval<> 0
begin
insert into decaissements_sgxp_en_attente
select * from decaissements_sgxp
--RAISERROR('Problème de connexion', 16, 1)
-- WITH SETERROR;
rollback transaction
end
else
EXEC SP_TRANS_DECAISSEMENT_VERS_SGXP
GO
"trouble"
Unfortunately when connection is down I get error message
'Msg 3616, Level 16, State 1, Line 2'
'Transaction doomed in trigger. Batch has been aborted'
and locally made update is rolled back.
Is there a way to maintain this error and keep local updates?
Note that I'm using SQL Server 2005 on both PCs running Windows server 2003
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply