microsoft / SqlScriptDOM

ScriptDOM/SqlDOM is a .NET library for parsing T-SQL statements and interacting with its abstract syntax tree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Codepage='65001' or any numeric value is throwing Incorrect Syntax error in OPENROWSET query

SeenaAugusty opened this issue · comments

While running the below script in sqlproj using Visual Studio 17.9 preview 1, I am getting the error 'Incorrect syntax near '65001' while the same query runs successfully in SSMS 19.

SELECT *
FROM OPENROWSET(
BULK 'path_to_csv',
SINGLE_BLOB,
CODEPAGE = '65001' -- UTF-8 encoding
) AS t;

Also, the codepage that has numeric value without single quotes seems to work in both SSDT and SSMS
SELECT *
FROM OPENROWSET(
BULK 'path_to_csv',
SINGLE_BLOB,
CODEPAGE = 65001 -- UTF-8 encoding
) AS t;