Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8342009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:39:00+00:00 2026-06-09T05:39:00+00:00

I am trying to join 2 tables together and do a delete on it.

  • 0

I am trying to join 2 tables together and do a delete on it.

DELETE TableA 
FROM TableA a
INNER JOIN
TableB b on b.Id = a.Id
where title like 'test' 

The above is what I come up with however I keep getting

The DELETE statement conflicted with the REFERENCE constraint

I thought if I merge the 2 tables together then I will delete both at the same time and no constraints would be conflicted.

Am I missing something in my query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:39:02+00:00Added an answer on June 9, 2026 at 5:39 am

    First try to delete TableB with that title condition
    Then delete those records in TableA

    DELETE FROM TableB
    WHERE Id IN 
    ( SELECT Id FROM TableA WHERE title = 'test')
    
    DELETE FROM TableA
    WHERE title = 'test'
    

    Referential Constraints blocks you from deleting rows in TableA when you still have reference in TableB

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to join some data together from 2 tables, but on several columns.
I'm trying to join multiple tables together for building a report. The report lists
I'm trying to join some tables together in MySQL, but I seem to get
I am trying to join two tables together using C# linq to entities. One
I have been trying to join 4 tables together so I can retrieve data
I'm trying to generate a SQL query that can join two tables together and
I'm trying to put together a command to extract the data from different tables
I am trying to join three tables together but having a problem getting the
i'm trying to join 3 tables together but use an IF statment to only
I'm trying to join two relatively simple tables together, but my query is experiencing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.