ODBC SQL Server --  Delete on Linked table failed

Posted on 2012-08-14
Last Modified: 2012-08-14
I am confused about what is happening here... I can delete some records from within the table directly -- but there are 2 records I cannot delete via the linked connection. So -- I went into the table directly in the SQL Server -- and am getting a referential integrity error - there are child/related records that need to be deleted.

How do I set that up on the SQL Server? In Access the "child" records got deleted along with the parent records.

Thanks for your help.

Question by:Ei0914
    LVL 65

    Expert Comment

    by:Jim Horn
    Your SQL Server table is related to another table, and referential integrity is set, so the delete fails.

    >In Access the "child" records got deleted along with the parent records.
    Check that the delete was successful.  It may also not be the only relationship.
    LVL 5

    Accepted Solution

    In MS SQL we can use the ON DELETE CASCADE Foreign Key Contraint

    Author Comment

    Can you please direct me on how to set up "ON DELETE CASCADE Foreign Key Contraint"?
    LVL 5

    Expert Comment

    This link describes it in detail: CASCADE DELETE

    Author Comment

    I got it! Thanks for your help!

    Author Closing Comment

    Thanks a lot!

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now