I'd like to update many rows with each row having a possibly different value, while using only a single SQL query.
@Dot Net Seeker unfortunately I need to do a bulk update rather than insert but thanks, I may use that later in my project.Many times developers ask that is it possible to insert multiple rows into a single table in a single statement. Actually there are three different methods to insert multiple values into a single table.Currently developers have to write multiple insert statement when they insert values in a table. For greater detail, please follow the aforementioned link.We'll use the following table for this example: In order to make multiple updates, you can use a CASE block in SQL combined with an appropriate WHERE clause to select the appropriate rows and set the different values.
For example, in order to update the column `Country` based on column `ID` alone: Do NOT forget the WHERE clause otherwise all other values will be set to NULL.