I have a statement like
INSERT INTO target_table
SELECT columns, GETDATE()
FROM source_table JOIN other tables...
Normally it seems like GETDATE()
is evaluated once for the whole result set and all rows in target_table
have the same date value.
Is this a guarantee, or are there edge cases where GETDATE()
could return different values for different rows?
Obviously I could assign GETDATE()
to a variable to avoid issues -- my question is whether this is strictly necessary or not.