mercwrought
Programmer
Hi all, I have some questions and a scenario that I need some help understanding.
I have several tables that are continuously updated by several interfaces. I need to lock those tables then perform several tractions without the triggers firing.
Here is the code I am about to use.
My questions.
1. Will the begin and commit Tran lock out the table, so that no other inserts can occur while the triggers are off? I also need to be able to read from the table while it is locked out.
2. Only the outer most Begin and Commit count?
3. I’m also having a problem with the fact that the replication is getting in the way of this transaction. I think I have a solution for that but I have not got there yet. I would appreciate any suggestions.
Thx in advance for any input.
I have several tables that are continuously updated by several interfaces. I need to lock those tables then perform several tractions without the triggers firing.
Here is the code I am about to use.
Code:
…..
BEGIN TRAN
ALTER TABLE t1 DISABLE TRIGGER All
delete from t1 where idnumber in (@idnumberto,@idnumberfrom)
insert into t1 select * from #t1
ALTER TABLE t1 ENABLE TRIGGER All
COMMIT TRAN
……..
1. Will the begin and commit Tran lock out the table, so that no other inserts can occur while the triggers are off? I also need to be able to read from the table while it is locked out.
2. Only the outer most Begin and Commit count?
3. I’m also having a problem with the fact that the replication is getting in the way of this transaction. I think I have a solution for that but I have not got there yet. I would appreciate any suggestions.
Thx in advance for any input.