Will GETUTCDATE() return the same value if used twice in the same statement?

前端 未结 5 2116
迷失自我
迷失自我 2020-11-30 11:12

I have a trigger that automatically sets the CreationDate and ModifiedDate of the given entry to the current UTC time whenever a value is entered. (CreationDate will remain

5条回答
  •  没有蜡笔的小新
    2020-11-30 11:58

    Keeping the GETUTCDATE() in a variable is a better option as it assures that CreationDate and ModifiedDate remains same. However, I called GETUTCDATE() number of time per query and they all returned the same value, so to me it seems that GETUTCDATE() value remains same per query.

提交回复
热议问题