microsoft / SqlScriptDOM

ScriptDOM/SqlDOM is a .NET library for parsing T-SQL statements and interacting with its abstract syntax tree
MIT License
135 stars 18 forks source link

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

Closed SeenaAugusty closed 7 months ago

SeenaAugusty commented 9 months ago

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;

SeenaAugusty commented 9 months ago

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;