Cascading delete

In my consolidated database I have a foreign key between two tables with the
cascading delete integrity constraint applied.

The two tables are replicated (in their entirety) to a remote database.  In
the remote database should I have the delete integrity constraint applied in
the foreign key between the two tables?  If a record is deleted from table A
in the consolidated database and this cascades and deletes a record in table
B, won't the individual delete statements from the transaction log be
applied to the remote database thus removing the need for the "cascade" to
be present in the foreign key in the remote database?

--
Peter Merwood
Circle Consulting Services

Email:  Peter_M@Circle-Consulting .co.nz
Web:  http://ourworld.compuserve.com/homepages/Peter_Merwood/


0
Peter
9/16/1998 12:13:22 AM
sybase.sqlanywhere.replication 4591 articles. 0 followers. Follow

5 Replies
405 Views

Similar Articles

[PageSpeed] 56

>The two tables are replicated (in their entirety) to a remote database.  In
>the remote database should I have the delete integrity constraint applied in
>the foreign key between the two tables?  If a record is deleted from table A
>in the consolidated database and this cascades and deletes a record in table
>B, won't the individual delete statements from the transaction log be
>applied to the remote database thus removing the need for the "cascade" to
>be present in the foreign key in the remote database?


I think that this would occur only if you chose to replicate trigger actions (-t on dbremote).  In
that case the replicated deletes would fail, but no error or warning message would appear. A delete
or update that fails to find its target row does not generate any kind of exception. 




Leo Tohill - Team Powersoft
-- Please post in newsgroup, not via email <
0
leotohill
9/16/1998 3:19:11 AM
Leo

> I think that this would occur only if you chose to replicate trigger
actions (-t on dbremote).  In
> that case the replicated deletes would fail, but no error or warning
message would appear. A delete
> or update that fails to find its target row does not generate any kind of
exception.

Sorry I'm still a little confused ...

Are you saying I should have my foreign keys in the remote database
configured with cascading deletes turned on?


--
Peter Merwood
Circle Consulting Services

Email:  Peter_M@Circle-Consulting .co.nz
Web:  http://ourworld.compuserve.com/homepages/Peter_Merwood/


0
Peter
9/16/1998 7:06:37 PM
>Are you saying I should have my foreign keys in the remote database
>configured with cascading deletes turned on?

I'm saying that it should be OK, although you will  generate replicated DELETEs that will fail on
the target - but that should not be terribly costly. 

This is book learning talking - you should test this!


Leo Tohill - Team Powersoft
-- Please post in newsgroup, not via email <
0
leotohill
9/17/1998 4:24:08 AM
Leo

>> This is book learning talking - you should test this!

Yeah - I'd come to that conclusion!  Thanks for your help.


-- 
Peter Merwood
Circle Consulting Services

Email:  Peter_M@Circle-Consulting .co.nz
Web:  http://ourworld.compuserve.com/homepages/Peter_Merwood/


0
Peter
9/17/1998 8:10:40 AM
The 'on delete cascade' function is internally implemented as a trigger. As
such the cascaded deletes are not replicated explicitly. This means that you
want to maintain the foreign key to on delete cascade in the remote as well
as in the consolidated. The cascaded deletes generated on the consolidated
will not replicate, so there is no redundant work being done while at the
same time the work load is being distributed by letting the remotes execute
the cascade operation.




0
Rob
9/29/1998 7:38:08 PM
Reply:

Similar Artilces:

Replication of Cascaded Deletes
We have an ASE consolidated database with several foreign key constraints. On our remote ASA database we have the same constraints with the "ON DELETE CASCADE" option. When deletes are cascaded on ASA and then replicated back to ASE, the deletes start with the parent tables first and then the children. Replication then fails, because the ASE foreign key constraints think that children are being orphaned. Is there a way around this problem? Not that I am aware of. You will have to control the deletes yourself instead of using CASCADE in ASA. -- David Fishburn Syba...

Cascading deletes - Which is better
I need to implement my cascading deletes on a SQL database.  Is it better (performance/reliablility-wise) to use the Foreign Key Cascading Deletes or to just write my own triggers to do the deletes?I was hoping someone had experimented and found which works best. DRI(declarative referential integrity) triggers are used when Cascade Deletes and Updates cannot be implemented in the RDBMS(relational database management system) as in SQL Server 7.0 and below.  In SQL Server 2000 using Cascade Delete and Cascade Update is the way to go.  The reason is reliability related because ...

Replicate in Cascade for 3 or more Databases with Replication Server
Hi. We want to make a table-to-table replication schema for 3 or more databases using this architecture: The row is created/modified in the first ASE, then, this row is saved in central ASE using Rep Server, and this central ASE replicate this row to other Remotes ASE's, in a cascade fashion. The replication must be bi-directional, and we want that all ASE's are always synchronised with the same data. We try to do this with 3 ASE's, one origin, one repository and one remote, but the record replicates only to the repository and not to the remote ASE. Anyone knows ...

Is Cascading deletes prefered to deleting thru a stored procedure?
I have a situation in which I have three tables - 'Table1', 'Table2' and 'Table3'. 'Table1' is a primary table for 'Table2' so that the the primary key of 'Table1' is a foreign key in 'Table2'. In the same way, 'Table1' is also the primary table for 'Table3'. If I delete a row in 'Table1' then I could automatically let SQL Server also delete the related rows in 'Table2' and 'Table3' through 'cascading delete' option. Or I could run a trigger or stored procedure for deleting related rows in 'Table2' and 'Table3'. Which of these methods would be quicker? Also would cascading deletes option a...

cascade delete
Does anyone know how to implement cascade delete within ASE on tables with foreign keys? If so please help me! I know that ASA has this capability but I can not find anything in ASE to support it. Here is my email if you have an answer pitsnogle@va.prestige.net thanks, Richard ASE does not support declarative cascading deletes through referential integrity. If you want to do cascading deletes, you will have to write triggers to handle your foreign keys, rather than using the constraints. -bret Rich and Peg wrote: > Does anyone know how to implement cascade dele...

delete cascade
I'm trying to add delete cascade to an already-existing table via ISQL. I'm getting a syntax error: alter table carrier on delete cascade; Error = syntax error near 'on' Should I be able to do this? I'm running on Windows 2000 Pro, SQLAnywhere 5.5.03, using DBENG50.EXE. It should be something like: alter table carrier drop foreign key fk1 alter table carrier add foreign key fk1 references ... etc ... on delete cascade Then when the row in the fk1 table is deleted the row in the "carrier" table will be deleted also. -- Steve http://www...

CASCADE deletes
In SQL Central, how do I set sqlanywhere to enforce referential integrety and delete all foreign keys when a record is deleted? Thanks for any help, Randy Nelson >In SQL Central, how do I set sqlanywhere to enforce referential integrety >and delete all foreign keys when a record is deleted? To create a foreign key you can click on the "Add foreign Key" line to start a fkey creation wizard. To change the properties of an existing foreign key definition, Right click on the foreign key and choose Properties. Click the 'Integrity' tab. Under "de...

CASCADE ON DELETE
Hi, Just a quick question: will ASE 12.5 support CASCADE ON DELETE on table creation? Take care, Yicheng ...

Cascading Deletes
I'm trying to implement cascading deletes in Sybase via a trigger. I know I can't just specify this when I create the foreign key constraint. So, my question is this, which will fire first, the RI or the trigger? If it's the former, then I won't be able to delete any children because the parent will exist. Is there a clean workaround if this is the case? Thanks! Arthur ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp Don't use the constraints. Use only the triggers for your RI. Bob Densmore Arthur Lan...

CASCADE ON DELETE?
I didn't create the database I'm now working with, in SQLAnywhere 5.0. I want to delete a large number of records and have it do a CASCADE on DELETE. How do I check if this particular referential integrity constraint exists for this table? On Mon, 04 Jan 1999 15:34:05 -0500, "Rick Charnes" <rick.charnes@state.ma.us> wrote: >I didn't create the database I'm now working with, in SQLAnywhere 5.0. I >want to delete a large number of records and have it do a CASCADE on >DELETE. How do I check if this particular referential integrity constrai...

ON DELETE CASCADE
Good afternoon, I am seeing some conflicting information when I search for the ON DELETE CASCADE statement on the Internet. Does ASE 15.x support the ON DELETE CASCADE function or is this same functionality implemented via a trigger? Thanks in advance. Whatty Hi, I recall there is a feature request to have this function but don't know if it is in ASE 15.x yet (Change Request 289627) Also there is a similar request from ISUG which you can vote on to increase it priority. Enhancement ID 2235: http://my.isug.com/index.php?mo=is&op=vi&type=1&iid=...

Cascading Deletes
In PowerDesigner 9.5.2, is it possible to have all relationships in the PDM which have cascading deletes highlighted in a different color than the others. I'm hoping there is a way other than manually changing the color on each one. If you can handle a little VB Script writing, you can do it. There are a few sample scripts to start with. What you will need to do is: Spin through all of the references. For each, if the type is on delete cascade, then set the color attribute to something special. It really shouldn't be a lot of coding. If you need help, post back here ...

Delete cascade
Hello, I'm trying to use cascade delete on Sybase, but it doesn't work like SQL Server 2000. Does anyone know how to do it (I can't use a stored procedure, only triggers)? I've got a table that has referencied rows on another tables, and I want to delete these records when I delete the row on the parent table. This is the parent table CREATE TABLE dbo.tbl_Protocolo_x_Documento ( Cn_Protocolo int, Cn_Documento int, Ds_Motivo varchar(255), CONSTRAINT PK_tbl_Protocolo_x_Documento PRIMARY KEY(Cn_Protocolo,Cn_Documento) ) GO...

Cascade Delete
PowerDesigner Version 9.0.0.438 and MS SQL 7.0 SP3. I need to be able to allow for Cascading deletes and updates. I see two problems at this point: One is the current code in the DBMS properties for Relationship Create is as follows: [%USE_SP_FKEY%?[execute ]sp_foreignkey %TABLE%, %PARENT%, %FKEYCOLUMNS% :alter table [%QUALIFIER%]%TABLE% add [constraint %CONSTNAME%] foreign key (%FKEYCOLUMNS%) references [%PQUALIFIER%]%PARENT%[ (%CKEYCOLUMNS%)]] In order for it to place the correct code I believe I need to have the following: [%USE_SP_FKEY%?[execute] sp_foreig...

Web resources about - Cascading delete - sybase.sqlanywhere.replication

Cascading Style Sheets - Wikipedia, the free encyclopedia
Cascading Style Sheets ( CSS ) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document ...

Ads API Profile: Alchemy’s Cascading Ad Creation, Analytics, and Auto-Optimization
Facebook’s performance advertising system provides buyers with a wealth of targeting options, but not the depth of control or analytics to effectively ...

Twitter blames global outage on 'cascading bug'
AFTER nearly a year without any significant periods of downtime, using Twitter was almost nothing like the early days of being on the service. ...

In defence of Gen Y, and cascading generations, by a boomer
Some accuse Generation Y of feeling entitled, overly precocious, demanding and rude but that doesn't necessarily reflect reality.

In defence of Gen Y, and cascading generations, by a boomer
Some accuse Generation Y of feeling entitled, overly precocious, demanding and rude but that doesn't necessarily reflect reality.

Cascading Style Sheets - 9to5Mac
Adobe announced updates on Thursday to many of its HTML5 design tools for Creative Cloud users. Among the updates, we get new features for Edge ...

West Texas Cascading Safety Failure
In the interests of Calamity Fairness, here’s a most depressing Bloomberg article : Texas Explosion Seen as Sign of Weak U.S. Oversight The ...

Watch this captivating video of 11,000 marbles cascading down a marble run
Everyone has a hobby. Some people like to play recreational sports, others prefer to go fishing, but did you know there are creative types out ...

Austria Announces Fence With Slovenia; Irony of German Whine; Cascading Fences; Mish Proposed Strategy ...
Two months ago, Austria's chancellor Werner Faymann criticized Hungary for building a fence along its border. Faymann proclaimed "To think that ...

Cascading Slopes is Jacob from The Drums' new band, NYC residency this month
Cascading Slopes at Cameo, 1/31/2013 (via @FreshBread) Cascading Slopes is a new project from Jacob Graham of The Drums. Unlike his other band, ...

Resources last updated: 11/27/2015 5:51:50 AM