Skip to main content
edited body
Source Link
Paul White
  • 90.3k
  • 30
  • 424
  • 663

I have two tables: dbo.old_rolesdbo.old_roles and dbo.new_roles dbo.new_roles. I I need to sync between the two  . When

When created or modified role in one table it should update the other one.

  To do it I created a trigger in each of the tables  .

To prevent a loop ., I want to disable the trigger in one table when a trigger is fired from the other table  .

When I call to ALTER TRIGGERALTER TRIGGER statement. I, I get an error  .

What can I do .

10x?

I have two tables: dbo.old_roles and dbo.new_roles . I need to sync between the two  . When created or modified role in one table it should update the other one.

  To do it I created a trigger in each of the tables  .

To prevent a loop . I want to disable the trigger in one table when a trigger is fired from the other table  .

When I call to ALTER TRIGGER statement. I get an error  .

What can I do .

10x

I have two tables: dbo.old_roles and dbo.new_roles. I need to sync between the two.

When created or modified role in one table it should update the other one. To do it I created a trigger in each of the tables.

To prevent a loop, I want to disable the trigger in one table when a trigger is fired from the other table.

When I call to ALTER TRIGGER statement., I get an error.

What can I do?

Tweeted twitter.com/StackDBAs/status/809595571837304832
Source Link
itzik Paz
  • 631
  • 1
  • 11
  • 27

Disabled or enabled trigger from another trigger

I have two tables: dbo.old_roles and dbo.new_roles . I need to sync between the two . When created or modified role in one table it should update the other one.

To do it I created a trigger in each of the tables .

To prevent a loop . I want to disable the trigger in one table when a trigger is fired from the other table .

When I call to ALTER TRIGGER statement. I get an error .

What can I do .

10x