0

我不断在 SSMS(使用 v17.7)和 RedGate SQL Prompt 中收到警告:

const UDF 的错误使用

它强调SYSUTCDATETIME()

以下SYSUTCDATETIME()两处都有下划线

   SELECT 2
     FROM (VALUES (CAST('2020-06-26' AS DATETIME2(7)))) AS s (SampleAt)
    WHERE s.SampleAt BETWEEN SYSUTCDATETIME() AND DATEADD(DAY, 100, SYSUTCDATETIME())

以下内容根本没有强调它:

    SELECT 2
     WHERE CAST('2020-06-26' AS DATETIME2(7)) BETWEEN SYSUTCDATETIME() AND DATEADD(DAY, 100, SYSUTCDATETIME())

也根本没有强调它:

DECLARE @now AS DATETIME2 = SYSUTCDATETIME()

   SELECT 2
     FROM (VALUES (CAST('2020-06-26' AS DATETIME2(7)))) AS s (SampleAt)
    WHERE s.SampleAt BETWEEN @now AND DATEADD(DAY, 100, @now)

4

1 回答 1

2

我与开发人员进行了交谈。这是工具中的一个错误。感谢您识别它。他们正在积极努力进行修复,应该很快就会发布。

于 2020-07-17T10:29:41.907 回答