[AccessD] How does SQL Server do updates

Jim Dettman jimdettman at verizon.net
Tue Oct 9 07:11:29 CDT 2012


 I believe this is incorrect.  SQL Server only needs to move a record if it
becomes larger, or if a field that is changed is part of a clustered index
(in that case, the record will most likely be moved to a new page).

 I can't imagine any RDBMS today would take the inefficient route of
updating a record by always deleting the original and then inserting it,
even within the same page.  It may appear that way, but I doubt that's what
actually happens.

 Inserting a record for an RDBMS is always an expensive operation.

Jim.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark Simms
Sent: Monday, October 08, 2012 08:26 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] How does SQL Server do updates

One question: WHY ?

> SQL Server doesn't ever physically update a row, but instead does an
> insert and a delete. This can be verified by creating a trigger For
Update,
> inside which you'll find the tables #inserted and #deleted. In #inserted
> you'll find some of the original row's columns, with new values for the
> columns you changed. Then SQL deletes the row(s) in #deleted, and inserts
the
> "replacement" rows in #inserted.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list