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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:42:50+00:00 2026-06-13T09:42:50+00:00

I have inherited an old database which wasn’t designed very well. It is a

  • 0

I have inherited an old database which wasn’t designed very well. It is a Sql Server 2008 database which is missing quite a lot of Foreign Key relationships. Below shows two of the tables, and I am trying to manually create a FK relationship between dbo.app_status.status_id and dbo.app_additional_info.application_id

enter image description here

I am using SQL Server Management Studio when trying to create the relationship using the query below

USE myDatabase; 
GO ALTER TABLE dbo.app_additional_info 
ADD CONSTRAINT FK_AddInfo_AppStatus FOREIGN KEY (application_id) 
    REFERENCES dbo.app_status (status_id) 
    ON DELETE CASCADE
    ON UPDATE CASCADE ; 
GO

However, I receive this error when I run the query

The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
“FK_AddInfo_AppStatus”. The conflict occurred in database
“myDatabase”, table “dbo.app_status”, column ‘status_id’.

I am wondering if the query is failing because each table already contains approximately 130,000 records?

Please help.

Thanks.

  • 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-13T09:42:51+00:00Added an answer on June 13, 2026 at 9:42 am

    The error is occuring because there is a value in dbo.app_additional_info.application_ID that is not in dbo.app_Status.Status_ID. Unless the naming convention is seriously messed up you are trying to add a relationship to unrelated columns, why would application_ID reference status_ID?

    I expect that dbo.App_Additional_Info.Application_ID should be referencing dbo.Application.Application_ID (Guessing at the table and column names slightly) so you would want this:

    USE MyDatabase
    GO
    ALTER TABLE dbo.App_Additional_Info
    ADD CONSTRAINT FK_App_Additional_Info_Application_ID (Application_ID)
        REFERENCES dbo.Application (Application_ID)
        ON DELETE CASCADE
        ON UPDATE CASCADE;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inherited a SQL server database which isn't normalised and is giving me
I inherited a database from an old system we have, in which (among other
I have inherited a very old database that needs some data to be updated.
I have a local Microsoft SQL Server Compact 3.5 database (.sdf) in my WPF
I'm about to have to rewrite some rather old code using SQL Server's BULK
I have 'inherited' a test harness application which uses Enterprise Library for its SQL
I have inherited a old access database that includes a table with data organised
I have inherited couple of .Net (C#) application which does not have any tracing
I inherited an old Database where dates are stored as Int32 values (times too,
I have run into an interesting problem. I have inherited a database for daemon

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.