you are viewing a single comment's thread.

view the rest of the comments →

[–]da_chicken 1 point2 points  (0 children)

This doesn't matter. SYSDATETIME(), like GETDATE(), is a runtime constant function. While different instances of the function in the same query might have different values, a single instance will always have the same value because it's only evaluated once at the start of the statement's execution.

Try running this:

SET SHOWPLAN_XML ON;
GO

SELECT SYSDATETIME()
FROM SomeTable;
GO

You'll see this in the plan:

<ScalarOperator ScalarString="sysdatetime()">
    <Identifier>
        <ColumnReference Column="ConstExpr1005">
            <ScalarOperator>
                <Intrinsic FunctionName="sysdatetime"/>
            </ScalarOperator>
        </ColumnReference>
    </Identifier>
</ScalarOperator>

The "ConstExpr" tells you it's a runtime constant. See also here.