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 6629319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:14:36+00:00 2026-05-25T22:14:36+00:00

I have two table table1 and table2. I have a record in table1. I

  • 0

I have two table table1 and table2. I have a record in table1. I want to insert record into table2. but it comes up with the following Exception.

Msg 547, Level 16, State 0, Line 2
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Table2_<Column3>". The conflict occurred in database "<databaseName>", table "table1", column 'Id'.

The constraint on the table2 is like this.

ALTER TABLE [dbo].[table2] ADD  CONSTRAINT [DF__table2__name__0B91BA14]  DEFAULT ((0)) FOR [column4]
  • 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-05-25T22:14:37+00:00Added an answer on May 25, 2026 at 10:14 pm

    The exception message is telling you which constraint is causing the issue. It’s against Column3 (at least that’s what the name suggests) and is a foreign key constraint against table1.

    You’re not showing any sample SQL but it would appear you’re trying to insert data in to table2 where the foreign key value specified for Column3 does not exist in table1.

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

Sidebar

Related Questions

I have a table with two child tables. For each record in the parent
I have two tables: table1, table2. Table1 has 10 columns, table2 has 2 columns.
I have two tables (TABLE1, TABLE2 - unique i know) that has a 1-to-many
I have a database with two tables ( Table1 and Table2 ). They both
I have the following two tables: Table1 ---------- ID Name 1 A 2 B
I have a process that starts a transaction, inserts a record into Table1, and
I have two Tables in two different databases Database1 - Table1 Database2 - Table2
I have the following tables with their insert script: DECLARE @A TABLE ( [ID]
I want to insert a row of data into a table with five columns
I have a table and want to insert the current values of records that

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.