lets say i have very big table ( many rows)
and i have this sql cmd :
update myTable set name='Royi' , dateUpadted=getDate()
again , many rows … – time to update whole table : 3 min. ( already indexed)
my goal is :
each updated row should have its true ( seconds / miliseconds difference) getdate() !!!
so my desire result :
name | dateUpadated
___________________
royi | 12:00:00 -- getDate() here was 12:00:00
... | ...
... | ...
... | ...
royi | 12:01:13 -- getDate() here was 12:01:13
... | ...
... | ...
... | ...
royi | 12:03:01 -- getDate() here was 12:03:01
how can I do it ?
( I dont want to us cursor)
is there any switch which says to getDate() function :
” use your current value and not the one which youve started with ” ?
You can wrap it inside a scalar UDF to get it to be re-evaluated for each row.