Update Multiple Records with Array of Values

Posted on 2010-11-28
Last Modified: 2012-08-13

I found the update query structure on another post, and wanted to confirm this syntax will work.  I am expecting to only update the field DESCR for 3 records in the example given.   Does this look ok?



                WHEN '1000029707' THEN 'APPLES CUYAMA'
            WHEN '1000007698' THEN 'APPLES GINGR GOLD ORGANIC'
            WHEN '1000007701' THEN 'APPLES GRNNY SMITH ORG'

WHERE ITEM_NO IN ( '1000029707' , '1000007698' , '1000007701')
Question by:AD1080
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34224413
The syntax seems to be right. Any error with it ?

LVL 23

Accepted Solution

Rajkumar Gs earned 50 total points
ID: 34224421
'CASE' can be used as conditional. In your query, when ITEM_NO column have the value '1000029707', it will update DESCR column with  'APPLES CUYAMA' and so on


Author Closing Comment

ID: 34224429

No error.  Thanks for taking the time to confirm.  Just wanted to be 100% before updating a lot of records using this approach.

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question