'INTERVAL' is not a recognized ODBC date/time extension option
-
04-01-2021 - |
문제
According to this docs on Interval Literals, this should be a valid INTERVAL
,
SELECT {INTERVAL '326' YEAR(4)};
But when I try that on dbfiddle, I get,
Msg 155 Level 15 State 1 Line 1
'INTERVAL' is not a recognized ODBC date/time extension option.
Is that error a fault of dbfiddle, SQL Server, or the ODBC transport layer not knowing how to textify a interval -- I tried adding it to a date, hoping that would produce a date but alas same error?
If I try it without the {}
, I get
Msg 102 Level 15 State 1 Line 1
Incorrect syntax near 'YEAR'.
해결책
Looks like a dbfiddle isn't using ODBC. The "'INTERVAL' is not a recognized" error will be returned by SqlClient.
SqlClient looks like it supports ODBC escape sequences that have corresponding SQL Server data types but I can't find this behavior documented. The error occurs because there is currently no INTERVAL
type in Microsoft SQL Server.
제휴하지 않습니다 dba.stackexchange