all groups > sql server replication > january 2007 >
You're in the

sql server replication

group:

Triggers on replicated tables making Updates tough.


Triggers on replicated tables making Updates tough. ChrisR
1/4/2007 9:14:43 AM
sql server replication:
Howdy all. I just set up Transaction, Immediate Updating replication on two
2005 boxes, replicating the adventureWorks DB. One table in particular
(Person.AddressType) contains an Update trigger. When I try to Update a
value on that table, I get the message "Maximum Stored Proc, function,
trigger, or view nesting level exceeded (limit 32)". I found some article
similar online, but nothing really pertaining to replicated tables. I know
it's due to replication because when I remove replication on the table it
works wiothout a hitch. What gives?

TIA, ChrisR

Re: Triggers on replicated tables making Updates tough. Paul Ibison
1/4/2007 4:45:00 PM
Presumably you have an infinite loop here due to nested triggers updating
the same row. Does your trigger update the same row that causes it to fire
on the table? In this case you could set the trigger order and have the
trigger only run its update based on the TRIGGER_NESTLEVEL value.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Re: Triggers on replicated tables making Updates tough. ChrisR
1/4/2007 7:59:55 PM
But how would this explain only happening when the table is replicated?


[quoted text, click to view]

AddThis Social Bookmark Button