Re: Mass Update

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

From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 01/12/05


Date: 12 Jan 2005 02:43:55 -0800

If the IDs are consecutive then maybe you can use a single query like
this:

UPDATE ict
SET prev=id-1, next=id+1, blockstart=1200, blockend=1345
WHERE id BETWEEN 1235 AND 5234 ;

However, this looks a little strange. If the Prev and Next columns are
always derived from the previous ID value then they are redundant
anyway. What are those columns for?

-- 
David Portas
SQL Server MVP
--


Relevant Pages