473,378 Members | 1,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Instead of Delete in replication

I am looking into work-arounds for what seems to be a flaw, or
"undocumented feature" of SQL Server replication and Instead of Delete
triggers not playing together. It seems that if you want to use
replication then you cannot use Instead Of triggers as it prohibits the
replication triggers from firing. My delima is that I need to cascade
delete, but first have the record and all child records inserted into
associated delete tables (<tablename>_del). This worked well using
Instead of delete triggers, but now we are moving to a replication
environment and it does not synchronize deletes to the publisher or
subscriber.

The options I am looking into and the stumbling points they introduce
are:

1. Not using Instead Of triggers, but using After to insert the
deleted record into a <tablename>_del table (where of course
<tablename> is the actual table name). The triggers are designed to
cascade delete all related child records. The problem with this
option is that there are relationship constraints that cause the
delete to raise an error complaining about these constraints. Of
course the child records need to be deleted first, but since this
runs after the delete I cannot perform this cascade delete via
trigger (or can I?).

2. Same as above only using SQL Server 2k's "Cascade Delete"
option. My question on this is, will the cascade delete execute the
After Delete triggers for each child table in the relationship? If
not, is there a way to move these deleted records into
<tablename>_del before they are deleted, keeping in mind that it
must be compatible with merge replication.

3. Not yet found any information on this, but is it possible to
manually include information to be replicated after the "Instead Of"
triggers so that the changes are included in the replication?
I really appreciate the advice.

Jul 23 '05 #1
3 3131
I'm loosing hope. Can anyone point me in the right direction here? Is
there a way to either mimic an Instead of Delete trigger or to manually
add records to the MSmerge_tombstone table after a Instead Of Delete
trigger is run?

Please, any advice is appreciated.

-Thanks

Jul 23 '05 #2
I'm loosing hope. Can anyone point me in the right direction here? Is
there a way to either mimic an Instead of Delete trigger or to manually
add records to the MSmerge_tombstone table after a Instead Of Delete
trigger is run?

Please, any advice is appreciated.

-Thanks

Jul 23 '05 #3
cfxchange (aa****@cfxchange.com) writes:
I'm loosing hope. Can anyone point me in the right direction here? Is
there a way to either mimic an Instead of Delete trigger or to manually
add records to the MSmerge_tombstone table after a Instead Of Delete
trigger is run?

Please, any advice is appreciated.


The only advice I have is to try microsoft.public.sqlserver.replication at
msnews.microsoft.com.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Cherrish Vaidiyan | last post by:
Hello, I have certain doubts regarding replication of Oracle 9i in Red Hat Linux 9. 1) I want to implement asynchronous/synchronous multimaster replication.I have heard about Replication...
0
by: Cherrish Vaidiyan | last post by:
Frank <fbortel@nescape.net> wrote in message news:<bqgb99$a04$1@news1.tilbu1.nb.home.nl>... > Cherrish Vaidiyan wrote: > > Hello, > > > > I have certain doubts regarding replication of Oracle 9i ...
3
by: steve | last post by:
Hi, several years ago , I implemented the oracle replication system. At that time our database was ported from an old Fox pro application. ( K , no laughing at the back). As the foxpro...
2
by: Greg | last post by:
Hi All- I have searched around a bit and haven't found anything that addresses my exact question... I have a db that is moderately busy (a couple million records added over a day, 60-300 db...
3
by: dlesandrini | last post by:
I need advice about my decision to go with Replication in general. This post was placed on the Microsoft Replication newsgroup, but I really value the feedback that comes from this group as well. ...
56
by: Raphi | last post by:
Hi, I've been using an Access application I wrote for an office with the front-end stored on all computers and the back-end on one of them serving as an Access file server. Now we're moving...
9
by: David W. Fenton | last post by:
See: Updated version of the Microsoft Jet 4.0 Service Pack 8 replication files is available in the Download Center http://support.microsoft.com/?scid=kb;en-us;321076 This includes the Jet 4...
3
by: Gert van der Kooij | last post by:
Hi, Our SQL Replication is between DB2 databases on Windows servers. I'm searching for the document which tells me how to migrate our SQL Replication environment from V8 to V9 (we also need to...
2
by: Query Builder | last post by:
Hi, I have transactional replication set up on on of our MS SQL 2000 (SP4) Std Edition database server Because of an unfortunate scenario, I had to restore one of the publication databases. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.