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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:58:34+00:00 2026-05-23T17:58:34+00:00

I have two tables and I want to use the database to enforce a

  • 0

I have two tables and I want to use the database to enforce a constraint against them.

Table A has a one to many relationship with table B, that is many table B rows belong to exactly one table A row. Table B has a column of the Table A primary key that it belongs to. Anyway, I want to add a column to both table A and table B where the value of it in a table A record must equal the value of it in the corresponding table B records.

I want to tell SQL Server 2000 to disallow updates or additions of table B records unless the values in the sister columns are the same. How can I do this? I tried using a check constraint but it doesn’t like subqueries. Will I have to venture into the world of triggers? Is there another way?

Any help would be appreciated.

Thanks

Isaac

  • 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-23T17:58:35+00:00Added an answer on May 23, 2026 at 5:58 pm

    What you’re trying to do sounds like a foreign key relationship – but you already seem to have that (Table B has a column of Table A primary key).

    I don’t think you can define such a constraint – CHECK constraints cannot span tables, as far as I know. So in the end, you will probably need to use triggers instead on both tables to achieve this.

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

Sidebar

Related Questions

My database has two tables, question and field. Questions may have many fields, and
I have two database tables. One table stores data for a commitment that a
I have two database tables (lets call them A and B) with many-to-many bridge
I have two tables Loan(Parent Table) and Receipt(Child table)what i want to do is
I have two tables and two buttons. I want table-1 to be in the
I have two tables in a database, one lists package and one lists dependencies:
I currently have two joined tables in a SQL Server database, one with news
I want to have the equivalent of two completely unrelated tables in my database,
I have a 1:1 relationship between two tables. I want to find all the
I have two tables in MySQL sales database: Orders table: CREATE TABLE salestest.`orders` (

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.