आप सत्र चर का उपयोग कर सकते हैं:
SET @r := -1;
UPDATE mytable
SET mydate = mydate + INTERVAL (@r := @r + 1) DAY;
SQL Server 2005
में :
WITH q AS
(
SELECT *,
ROW_NUMBER() OVER (ORDER BY mydate) rn
FROM mytable
)
UPDATE q
SET mydate = DATEADD(d, rn - 1, mydate)