boardtc
Programmer
- Dec 1, 2004
- 22
I need all the null dates to be different by 1 millisecond. I try
declare @date datetime
set @date = dateadd(week, -2, getdate())
update conditions
set LastUpdated = dateadd(millisecond,1,@date)
where (LastUpdated is NULL)
I can't see how I can do it without some loop.
Could I do it in conjunction with adding the "row number"? :
select RowNumber = (select count(*)
from conditions as a2
where a2.oid <= a1.oid)
from conditions as a1
Any other ideas?
Thanks, Tom.
declare @date datetime
set @date = dateadd(week, -2, getdate())
update conditions
set LastUpdated = dateadd(millisecond,1,@date)
where (LastUpdated is NULL)
I can't see how I can do it without some loop.
Could I do it in conjunction with adding the "row number"? :
select RowNumber = (select count(*)
from conditions as a2
where a2.oid <= a1.oid)
from conditions as a1
Any other ideas?
Thanks, Tom.