Showing posts with label triggers. Show all posts
Showing posts with label triggers. Show all posts

Tuesday, February 14, 2012

constraints implemented in Triggers and replication

Hi Friends,
I have some problems with my merge replication because i have the
constraints created with Erwin implemented in triggers not like foreign
keys, i'm looking for a tool or strategy for converting this constraints to
FK's.
Please help.
Hi Paul,
My problem is in my merge replication. I have'nt Foreign Keys in then BD,
when the replication run, the insert or update or delete statment cause error
because dont have a order of insertion or update or delete because in our
application we have a order.
think you.
Please help.
"Paul Ibison" wrote:

> What problems are you seeing from the triggers? If you
> don't want them to fire as a result of the replication
> process, you can specify NOT FOR REPLICATION on the
> trigger definition. If the problem is that the triggers
> are causing recursion, you can investigate
> sp_check_for_sync_trigger.
> HTH,
> Paul Ibison (SQL Server MVP)
>
>
|||Chouaib,
using NOT FOR REPLICATION in the trigger definition will
mean that the triggers which you have to check
Referential Integrity will not fire during the
replication process. This would seem to fix your issue?
Rgds,
Paul Ibison (SQL Server MVP)
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||thank you paul,
i try that but i have more that one thousands of triggers.
regards.
"Paul Ibison" wrote:

> Chouaib,
> using NOT FOR REPLICATION in the trigger definition will
> mean that the triggers which you have to check
> Referential Integrity will not fire during the
> replication process. This would seem to fix your issue?
> Rgds,
> Paul Ibison (SQL Server MVP)
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||If you script them out into a single file using EM, you
might be asble to replace 'AS' with 'NOT FOR REPLICATION
AS' then run the script.
Rgds,
Paul Ibison (SQL Server MVP)
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||THANK YOU PAUL'
I DO THAT.
"Paul Ibison" wrote:

> If you script them out into a single file using EM, you
> might be asble to replace 'AS' with 'NOT FOR REPLICATION
> AS' then run the script.
> Rgds,
> Paul Ibison (SQL Server MVP)
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>

Constraints and Triggers

We have a database that is using triggers to support referntial integrity.
Is it possible to use constraints on new tables and slowly replace triggers
with constraints in the future?
David
Yes you can migrate to foreign key constraints instead of using triggers.
This is the preferred method and can improve performance as well.
Hope this helps.
Dan Guzman
SQL Server MVP
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:u1uday5MFHA.1308@.TK2MSFTNGP15.phx.gbl...
> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace
> triggers with constraints in the future?
> David
>
|||Yes, it is much better to use FK instead of triggers
Look at cascade on delete,cascade on update in the BOL.
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:u1uday5MFHA.1308@.TK2MSFTNGP15.phx.gbl...
> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace
triggers
> with constraints in the future?
> David
>
|||David,
Sure, and this is what Microsoft recommend, to enforce RI using DRI.
AMB
"David C" wrote:

> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace triggers
> with constraints in the future?
> David
>
>

Constraints and Triggers

We have a database that is using triggers to support referntial integrity.
Is it possible to use constraints on new tables and slowly replace triggers
with constraints in the future?
DavidYes you can migrate to foreign key constraints instead of using triggers.
This is the preferred method and can improve performance as well.
Hope this helps.
Dan Guzman
SQL Server MVP
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:u1uday5MFHA.1308@.TK2MSFTNGP15.phx.gbl...
> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace
> triggers with constraints in the future?
> David
>|||Yes, it is much better to use FK instead of triggers
Look at cascade on delete,cascade on update in the BOL.
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:u1uday5MFHA.1308@.TK2MSFTNGP15.phx.gbl...
> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace
triggers
> with constraints in the future?
> David
>|||David,
Sure, and this is what Microsoft recommend, to enforce RI using DRI.
AMB
"David C" wrote:

> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace trigger
s
> with constraints in the future?
> David
>
>

Constraints and Triggers

We have a database that is using triggers to support referntial integrity.
Is it possible to use constraints on new tables and slowly replace triggers
with constraints in the future?
DavidYes you can migrate to foreign key constraints instead of using triggers.
This is the preferred method and can improve performance as well.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:u1uday5MFHA.1308@.TK2MSFTNGP15.phx.gbl...
> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace
> triggers with constraints in the future?
> David
>|||Yes, it is much better to use FK instead of triggers
Look at cascade on delete,cascade on update in the BOL.
"David C" <dlchase@.lifetimeinc.com> wrote in message
news:u1uday5MFHA.1308@.TK2MSFTNGP15.phx.gbl...
> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace
triggers
> with constraints in the future?
> David
>|||David,
Sure, and this is what Microsoft recommend, to enforce RI using DRI.
AMB
"David C" wrote:
> We have a database that is using triggers to support referntial integrity.
> Is it possible to use constraints on new tables and slowly replace triggers
> with constraints in the future?
> David
>
>