I have a trigger for executing two procedures.
ALTER TRIGGER [dbo].[TRG_SP_SYNCH_CAB]
ON [VTBO_INTERFACE].[dbo].[T_TRIGGER_TABLE_FOR_SYNCH]
INSTEAD OF INSERT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for trigger here
INSERT INTO T_TRIGGER_TABLE_FOR_SYNCH (DT)
VALUES (GETDATE());
exec PUMPOMAT_HO.DBO.SP_CM_TransferCAB
exec PUMPOMAT_HO.DBO.SP_CM_UpdateCAB
END
Execution time for two procedures is 5 mins. When I try to insert a value to T_TRIGGER_TABLE_FOR_SYNCH table, my other tables which are used in stored procedures are locked along 5 mins. But when I try to execute two procedures directly like
exec SP_CM_TransferCAB
exec SP_CM_UpdateCAB
No lock happens. What should I write in trigger to avoid of table locks.
Thanks.