DELETE statement conflicted with COLUMN REFERENCE constraint

  • Please any one can help with some sort of example to clear this Error ..

  • Hi , I am trying to Delete a record for table using one Specific Column ..

    It takes large amount of Execution time .. I noticed that because of the referenial Integrity .(Foriegn KEY )

    Is there any way to DELETE a specific record in a Table and the Record in the Referenced tables .....

    Very Very Thanks

    Please HELP ME ..

  • Duplicate posting at:

    http://www.sqlservercentral.com/Forums/Topic825684-1291-1.aspx

    Please answer in above forum

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • To answer your second question, yes, SQL Server offers the ability to "cascade" a delete or an update. Google or search this site for ON DELETE CASCADE and you'll find what you're looking for. I especially like using it for many-to-many relations to make sure I don't end up with orphaned rows in the join table.

    Just be sure to very carefully consider the implications of its use. Many application developers are nervous about deletes and prefer to use an isDeleted bit instead but there is something to be said for having a clean database.

    Another nice alternative to prevent orphans is to only give the applications operating on the database access to stored procedures that contain the delete statements inside of transactions.

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

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