Ms sql cascade delete

2 posts, 0 answers
  1. Derya Altuntas
    Derya Altuntas avatar
    5 posts
    Member since:
    Nov 2009

    Posted 17 Nov 2009 Link to this post

    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.
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 17 Nov 2009 Link to this post

    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.
  3. DevCraft banner
Back to Top