Updating rows in sql

Using T-SQL to insert, update, or delete large amounts of data from a table will results in some unexpected difficulties if you’ve never taken it to task.

Let’s say you have a table in which you want to delete millions of records.

In this article I will demonstrate a fast way to update rows in a large table Consider a table called which has more than 5 millions rows.

Suppose you want to update a column with the value 0, if it that column contains negative value.

Order ID == 11000 select ord; // Execute the query, and change the column values // you want to change. Ship Via = 2 ' Insert any additional changes to column values.

Combine the top operator with a while loop to specify the batches of tuples we will delete.

For more information, see WITH common_table_expression (Transact-SQL). For information about table hints, see Table Hints (Transact-SQL).

TOP ( ) Specifies one or more table hints that are allowed for a target table. @ Note When referencing the Unicode character data types nchar, nvarchar, and ntext, 'expression' should be prefixed with the capital letter 'N'.

He now has good level of knowledge in SQLServer, Oracle, My SQL and Postgre SQL as well.

He is also one of the leading posters at a moderator at

Search for updating rows in sql:

updating rows in sql-83updating rows in sql-79updating rows in sql-64

Leave a Reply

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

One thought on “updating rows in sql”

  1. Same as a 62 year old with a 42 year old, which now that I think about it is pretty close to my dad and his new wife. A 50 year old with a 30 year old, that are both happily married, to each other, is QUITE remarkable, to me. I dont like it it when people use examples like this.