Re: Compare Insert vs Update

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tom Moreau (tom_at_dont.spam.me.cips.ca)
Date: 09/30/04


Date: Thu, 30 Sep 2004 07:08:24 -0400

It generally depends on how many rows and what got touched. In an INSERT,
all indexes have to be updated. In an UPDATE, 0, 1 or many will get
updated. However, an INSERT of a single row should not be as heavy as an
UPDATE of many, but this really depends on the queries themselves. Testing
is the only way to find out.

-- 
   Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON   Canada
www.pinnaclepublishing.com
.
"Drew" <agarwalp@lucent.com> wrote in message
news:u9rJQltpEHA.1152@TK2MSFTNGP11.phx.gbl...
On compairing Insert vs Update, which statement causes more overhead to the
DB.
If i have a Table(col1 int primary key)
And there are  a million rows in it.
Now if i do a insert and update which statement causes more overhead to the
DB.


Relevant Pages