delete/truncate

  • could anybody please tell me how to delete/truncate data from tables. When i try to truncate/delete it gives error saying

    "DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_Order_Details_table1'. The conflict occurred in database 'ABC', table 'table2', column 'OrderID'.

    The statement has been terminated.

    Please help - Thanks

  • I had this same problem from a vendor DB. Basically the other table referneces information related to the table you are trying to delete data from. You need to look for that same information or however it references it and delete that info first from that table. In your case 'table 2'.   Good Luck.

  • You might also want to consider turning on Cascade Updates and Deletes for the relationship between tables (if this is appropriate for your data that is!)

    This would automatically delete the rows in the related table.

    Ben

  • You might also want to search the fora here on this keywords. This has been discussed a great depth recently.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

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

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