Skip to content

Problem with unicode quotes in Transact-SQL #942

@GregObleshchuk

Description

@GregObleshchuk

Describe the bug
An Unexpected Error Occurred
Parse error: Unexpected "​'@p0​' an" at line 5 column 4. SQL dialect used: "transactsql".

Please report this at Github issues page.

Stack Trace:

Error: Parse error: Unexpected "​'@p0​' an" at line 5 column 4.
SQL dialect used: "transactsql".
at T.default.createParseError (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:278047)
at T.default.tokenize (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:277813)
at T.default.tokenize (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:272790)
at T.default.tokenize (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:287994)
at T.default.reset (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:286521)
at T.S.feed (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:312761)
at Object.parse (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:288132)
at T.default.parse (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:16545)
at T.default.format (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:16443)
at T.formatDialect (https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js:1:307558)

format the SQL text

Actual behavior
What happened instead?

Usage
used: https://sql-formatter-org.github.io/sql-formatter/
used transact-SQL

My input text

select 
top @p1 ltrim(rtrim(long_matt_name)) 
from sl_hbm_matter where matter_uno = @p2 and
 CONVERT(DATETIME,CONVERT(VARCHAR(@p3), last_modified)) 
<='@p0​' and CONVERT(DATETIME,CONVERT(VARCHAR(@p3), sl_entry_date))
 >='@p0​' order by sl_entry_date desc

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions