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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:27:04+00:00 2026-06-13T18:27:04+00:00

I am using SQL Server, and in the query below, I have a concern.

  • 0

I am using SQL Server, and in the query below, I have a concern. I am not sure if the field on the left will update with the field on the right (coming from the same table) when I do a where in list.

update loc 
set locShortName = locName 
where locid in (3,4,11,13,14,15,16,18,19,20,21,24,32,41,45,68,69,77,82,85)

update loc set locShortName = locName where locid = 3 (move to next record in the list)      
update loc set locShortName = locName where locid = 4 (move to next record in the list)
update loc set locShortName = locName where locid = 11(move to next record in the list)

and so on…

I would think it would take the fist number in the list and address the field value setting, then move to the next in the list.

Are my expectations correct?

Thanks in advance.

  • 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-13T18:27:06+00:00Added an answer on June 13, 2026 at 6:27 pm
    update loc set locShortName = locName where locid in 
    (3,4,11,13,14,15,16,18,19,20,21,24,32,41,45,68,69,77,82,85)
    

    You can consider that it works like this:

    Take a row.
    If locid is in the list, will take the locName of that row and put it in locShortName.

    Take another row.
    If locid is in the list, will take the locName of that row and put it in locShortName.

    take another row.
    if locid isn’t in the list, it won’t do anything.

    And so on

    It do not process one each at time, but the concept result will be something like this

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

Sidebar

Related Questions

I'm using Sql-Server, and I have the below query which returns all columns that
We're using SQL Server 2000 Query Analyser, and one issue we have is that
Using SQL Server 2005 I have a query that gets child records from bundles
Background: I'm using SQL Server Management Studio 2008 and I have a query window
Using SQL Server 2000 My Query. SELECT (Format(IIf(CLng(OutTime) > 180000, CDate('18:00:00'), CDate(Format(OutTime, '00:00:00'))) -
I'm using SQL Server Analysis Studio 2008 to query a Naive Bayes classification model.
Snippet from a SQL query (using SQL Server 2008 R2): , CONVERT (VARCHAR(10), s.ENTER_DATE,
I'm using SQL Server 2008 and the following query to implement paged data retrieval
I am trying to learn SQL query optimization using SQL Server 2005. However, I
How to change column order in a table using SQL query in SQL Server

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.