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

  • Home
  • SEARCH
  • 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 5935715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:17:41+00:00 2026-05-22T15:17:41+00:00

Q: If I have a composite key combined from 4 fields for example, can

  • 0

Q:

If I have a composite key combined from 4 fields for example, can I update one of them?

I mean can I execute a statement like this:

UPDATE tb 
SET firstCol = '15', secondCol = 'test2' 
WHERE firstCol = '1' AND serial = '2';

Given:

  • my table name is: tb
  • my fields are: firstCol, secondCol, serial
  • my keys are: firstCol , serial

Any suggestions? Did I miss some concept?

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-05-22T15:17:42+00:00Added an answer on May 22, 2026 at 3:17 pm

    You may run into problems in updating if you try to make some row into the same values as an existing row. No matter what you do in an update, the unique constraint will still apply.

    If you have related tables and have cascade update turned on, you may have locking issues if many records need to be locked. If you do not have cascade update turned on, you may have issues where a PK cannot be changed until you break those relationships and then put them back after manually changing all the related tables to the new value. This task, either way, should only be done in single user mode during non-peak hours.

    Personally, if you need to change the PK, the design of your database is fragile and may cause problems in the future. Especially with a multicolumn key. If this is a one-time, rare change, go ahead and work through the issues. Otherwise, it might be time to decide if having a surrogate key as the PK and a unique index on the multi-columns is a better choice. Multicolumn PKs create much larger indexes not only on the main table but the child tables as well, they can create difficult issues when you need to update one of the columns, and they have performance implications for joins. In general I’m not a fan of them. And defintely not if there are some of those columns that will need updating with any frequency (and by that I mean any large update more than once a year – one or two records OK, but if you are running an update as described more often than once a year, you need to revisit the design in my opinion.).

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

Sidebar

Related Questions

I have two tables one has a three column composite key. The other needs
I have a composite primary key table (Maintenance Items). I would like to create
Is it possible to have a composite key in mysql(5.1) and if so, what
I have a composite primary key in 1 table in oracle. I want to
I have a table with a composite key composed of 2 columns, say Name
i have a table with two foreign keys as composite key. ActivityTbl - (activityNbr(PK),
I have a composite control that contains a ListBox child control. On postback, the
I have a composite control that adds a TextBox and a Label control to
Using C# .NET 2.0, I have a composite data class that does have the
Let's say I have a couple composite shapes ( <g> ). I want to

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.