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 ...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...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
Then when the row in the fk1 table is deleted the row in the "carrier" table
will be deleted also.
Thanks. So I understand that there is currently no cascading deletes in MS
SQL Server and you implement it using triggers or similar.
Correct. There is a LOT of stuff missing from MS SQL Server. You will
be much happier with SQL Anywhere.
On Tue, 26 Dec 2000 11:23:39 -0800, "Anand" <email@example.com>
>Thanks. So I understand that there is currently no cascading deletes in MS
>SQL Server and you implement it using triggers or similar.
...CASCADE ON DELETE
Just a quick question: will ASE 12.5 support CASCADE ON DELETE on table
...Deletes are not being deleted.
Using ASA 7.03
I am having a problem in deleting field service orders that have been
completed. Just getting started with sync so I am probably making a dumb
mistake or just leaving out a step.
The download_delete_cursor script is:
Select ordernumber from ServiceOrderEntryMaster where Tech = ? and
Order_Complete = 'Y'
This based on the verbose reply from the MobiLink Synchronization server is
picking the correct work order ( number 326 ) and showing a Delete Row line
in the log. But the work order is not being deleted on the remote side.
What could I be doing wron...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
ASE does not support declarative cascading deletes through referential
If you want to do cascading deletes, you will have to write triggers to
foreign keys, rather than using the constraints.
Rich and Peg wrote:
> Does anyone know how to implement cascade dele...cascading delete
This is a multi-part message in MIME format.
I'm using SYBASE Server 11 and Powerbuilder 7.02. I'm having =
problems with a trigger on a parent child relationship of two tables, =
FISH_TBL and FISH_LEN_TBL, with a foriegn key constraint on FISH_LEN_TBL =
using the primary key, FISH_ID from FISH_TBL. =20
To allow users to Delete a FISH_TBL record I have a trigger on =
delete for FISH_TBL that will delete all length rec...Cascading deletes
Were using these right?
Noticed that there is no DeleteBooks method, but a delete contentPage method -
I swear to god that we need to have a ContentItem class -
I know there is a ContentItem class defined under that darn ContentList repeater,
But I renamed mine to ContentItemContainer
I think that we should have a Content Item table in the DB
the HorrorGet ready to blast your energy levels into high gear with Sedgewick Energy Drink. High powered adaptogenic herbs mixed with potent levels of B-vitamins and...Please disregard the contents of this post....On Delete Cascade
I'm working on the porting of an application from Oracle to Sybase (ASE
11.9.2). Now I'm facing with the "on delete cascade" and "cascade
constraints" directives present in Oracle. Is there anything similar in
Sybase or is there any workaround?
Thanks to anybody can help me.
Gianpaolo Araco phone +39-06-47823776 - ext: 17
Web Bridges Srl fax +39-06-48906270
Via Mecenate 59 mailto:gianpaolo@web...on delete cascade?
This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
I'm new to Sybase SQL Server 11 and I'm wondering whether
there is any possibility to perform a cascading delete
in a master-detail-relationship using a foreign key constraint?
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Description: Card for Thomas Golob
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
In SQL Central, how do I set sqlanywhere to enforce referential integrety
delete all foreign keys when a record is deleted?
Thanks for any help,
>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...Cascading deletes
I need to know the best method to process cascading deletes with a SQL
Anywhere 5.0 DB. The user can delete certain records and I want to make
sure all child records are also deleted.
Thanks in advance.
The easiest thing to do is to use the build in cascading deletes option of
Geert 'Darling' Van Damme
Jason Csomay wrote in message ...
>I need to know the best method to process cascading deletes with a SQL
>Anywhere 5.0 DB. The user can delete certain records and I want to make
>sure all child records are also deleted.