• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1231
  • Last Modified:

ODBC SQL Server -- Delete on Linked table failed

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.

Eileen
0
Eileen Murphy
Asked:
Eileen Murphy
  • 3
  • 2
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
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.
0
 
ggzfabCommented:
In MS SQL we can use the ON DELETE CASCADE Foreign Key Contraint
0
 
Eileen MurphyIndependent Application DeveloperAuthor Commented:
Can you please direct me on how to set up "ON DELETE CASCADE Foreign Key Contraint"?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ggzfabCommented:
This link describes it in detail: CASCADE DELETE
0
 
Eileen MurphyIndependent Application DeveloperAuthor Commented:
I got it! Thanks for your help!
0
 
Eileen MurphyIndependent Application DeveloperAuthor Commented:
Thanks a lot!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now