Query Help

  • Hi Experts,

    Please help me.

    I am having a db which has got more than 200 tables and on delete cascade is not applied for it. Now i want to delete the records from child tables.

    Now the problem is, how to find the child tables so that i can write a SP to delete the records from Bottom level.

    Thanks in advance.

    With Regards,

    Vijay Singh.

  • Does the database have FK defined? If so you can right click on the table and find the dependencies. From there you can build your script on how to delete the records.

    If you don't have FK constraints; you must have data-model that explains that without it it will be almost impossible to do this.

    Thanks.

    Mohit.

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply