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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:04:28+00:00 2026-05-20T21:04:28+00:00

I have a table that contains a list of deparments. The key (‘code’ in

  • 0

I have a table that contains a list of deparments. The key (‘code’ in the sample) is just an assigned number. Unfortunately, this table now needs to accomodate some new software that comes with pre-defined deparment codes. Of course, these defined codes collide with the existing codes. I want to take the existing keys and increase each one by 200 to move them out of the collision space. I tried this query:

update  [TEST-PH].[dbo].[Emp_PosDepartments]
set Code = (select code + 200 from [TEST-PH].[dbo].[Emp_PosDepartments] o where o.Code = Code)

But when I try to run this against SQL server, I get the following message:

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Any suggestions how to accomplish the task of renumbering the keys?

  • 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-20T21:04:28+00:00Added an answer on May 20, 2026 at 9:04 pm

    The correct syntax doesn´t necessarily imply the use of a subquery:

    update  [TEST-PH].[dbo].[Emp_PosDepartments]
    set     Code = Code + 200
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my situation: I have one table that contains a list of drugs
I have a table that contains multiple dropdown menus for a list of profile
I have a mysql table (table-A) that contains a list of unique product ids.
I have a DB table that contains a comma separated list of ID's (ints)
I have a table that contains an Id column as a primary key. There
I have a table that contains a list of machines that are loaned out
I have a table that contains a list of EquipmentIDs and another table that
I have a table called Order_List that contains a list of orders. Each column
I have a table that contains events, to list these events I loop through
Suppose I have a table that contains a list of ids pointing to table

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.