为什么我在 SSMS 中不断收到 Incorrect usage of const UDF?
Why do I keep getting Incorrect usage of const UDF in SSMS?
我不断在 SSMS(使用 v17.7)和 RedGate SQL 中收到警告提示:
Incorrect usage of 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)
我与开发人员进行了交谈。这是工具中的错误。感谢您识别它。他们正在积极努力进行修复,应该很快就会发布。
我不断在 SSMS(使用 v17.7)和 RedGate SQL 中收到警告提示:
Incorrect usage of 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)
我与开发人员进行了交谈。这是工具中的错误。感谢您识别它。他们正在积极努力进行修复,应该很快就会发布。