This is a migrated thread and some comments may be shown as answers.

Ms sql cascade delete

1 Answer 91 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Derya Altuntas
Top achievements
Rank 1
Derya Altuntas asked on 17 Nov 2009, 09:34 AM
Hi,
I want to do cascade delete operation.When I delete an object from a table,all entities that have deleted object, also must be deleted.I have used Foreign Key Relationship in Microsoft SQL server.Then I try to delete using stored procedure,But I couldn't.I don't want to use telerik properties for cascade delete.Please help.

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 17 Nov 2009, 01:12 PM
Hi Derya Altuntas,

To achieve this you should do the following:

1.    Open the tables designs in SQL Management Studio
2.    Open the Foreign Key Relationship settings dialog
3.    Locate and expand the INSERT and UPDATE Specifications
4.    Set the Delete Rule option to Cascade
5.    Click on the Close button and save the changes

If you cannot modify the relationships, you can create a stored procedure which deletes all child objects and the parent afterwards. Then you can force OpenAccess to use this procedure (instead of dynamic SQL) when objects of the parent type are deleted. To do this, please follow the first half of this help article.

All the best,
Damyan Bogoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Databases and Data Types
Asked by
Derya Altuntas
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or