order of the relationship

  • query for order of the relationship

    i had relationship with all the tables

    how to delete the tables from child to master in sql server 2005

  • Delete the records in the tables you mean?

    If you defined the relationship with cascading option, then you can delete the master table and the records in child tables will also be deleted. Or else you will have to delete the child records first and then the master records.

    I am not sure if this was your question.

    -Roy

  • As Roy indicates, you can delete your child records and then delete the parant records. If the relationships are cascading, you can drop the parents and the children will automatically be deleted.

    Another way is to drop you foreign key constraints on your affected tables, delete the desired records, then verify that you have left no orphans before re-applying your foreign keys.

    Converting oxygen into carbon dioxide, since 1955.

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

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