Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 problem with the trigger

Author  Topic 

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-08-18 : 21:58:07
CREATE TRIGGER [tgr_tbl_track_master] ON dbo.tbl_request_log
FOR INSERT, UPDATE
AS

SET XACT_ABORT ON

DECLARE @order_id int
DECLARE @refer_id int
DECLARE @l_numb varchar(13)

SELECT @order_id=order_id ,@refer_id=refer_id,@l_numb=l_numb FROM inserted


IF EXISTS (select l_numb from tbl_master_details WHERE l_numb in (@l_numb))

BEGIN

UPDATE tbl_master_details
SET req='Y',refer_id=@refer_id,order_id=@order_id
WHERE l_numb=@l_numb

END



This is one trigger and this update works fine and as this trigger updates in the tbl_master_details it has a trigger which excutes a sequences
of stored procedure and the code is as below


CREATE TRIGGER [tgr_populate_details] ON tbl_master_details
FOR INSERT,UPDATE
AS

Declarations.....
..............


SET XACT_ABORT ON

--select the data from inserted and assigning to the variables then executing


IF @requested ='Y'

BEGIN


EXECUTE proc1

EXECUTE proc2


EXECUTE proc3

EXECUTE proc4

EXECUTE proc5
END

NOw it gives an error saying that the network is down but when u disable the trigger it works fine...

samsekar
Constraint Violating Yak Guru

437 Posts

Posted - 2004-08-19 : 04:05:46
Try executing each sp in the query analyser and find out where you exactly getting the error.

- Sekar
Go to Top of Page
   

- Advertisement -