Updating multiple rows in sql

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.

updating multiple rows in sql-3updating multiple rows in sql-63updating multiple rows in sql-45

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.

Join our conversation (7 Comments).
Click Here To Leave Your Comment Updating multiple rows in sql.


  1. 1

    You can also notice that beside each and every star rating is the amount of votes that each site has received thus far.

  2. 1

    Free membership chat and cams for your viewing pleasure.

  3. 1

    I’ve tried local dating websites and ended up with only three or four options.

  4. 1

    We do not keep our users' data or messages sent here, Chattusa automatically deletes all your message history whenever you logout, making Chattusa totally Anonymous and secure. We are trying our best to keep the Chat rooms as clean as possible, we are banning bots and bad users every day.

  5. 1

    for free chat rooms features, amazing online chat rooms, and mobile chat at the click of a mouse.

  6. 1

    Whatever it doesn’t hesitate, make the steps now to turn it into reality and enjoy the beauty of escort companionship.

Leave a Reply

Your email address will not be published. Required fields are marked *