November 27, 2009 at 9:55 am
Please any one can help with some sort of example to clear this Error ..
November 27, 2009 at 10:35 am
Hi , I am trying to Delete a record for table using one Specific Column ..
It takes large amount of Execution time .. I noticed that because of the referenial Integrity .(Foriegn KEY )
Is there any way to DELETE a specific record in a Table and the Record in the Referenced tables .....
Very Very Thanks
Please HELP ME ..
November 27, 2009 at 11:30 am
Duplicate posting at:
http://www.sqlservercentral.com/Forums/Topic825684-1291-1.aspx
Please answer in above forum
November 27, 2009 at 12:45 pm
To answer your second question, yes, SQL Server offers the ability to "cascade" a delete or an update. Google or search this site for ON DELETE CASCADE and you'll find what you're looking for. I especially like using it for many-to-many relations to make sure I don't end up with orphaned rows in the join table.
Just be sure to very carefully consider the implications of its use. Many application developers are nervous about deletes and prefer to use an isDeleted bit instead but there is something to be said for having a clean database.
Another nice alternative to prevent orphans is to only give the applications operating on the database access to stored procedures that contain the delete statements inside of transactions.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply