You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apostrophes are not escaped in square brackets, resulting in the syntax highlighting for .sql files breaking.
Steps to Reproduce the Issue
The below code adds a column with an apostrophe in the name.
--alter table Default_Test_Table add [bad_column'] nvarchar NULL
update Default_Test_Table set [bad_column'] = 'asdf'
update Default_Test_Table set [bad_column''] = 'asdf'
Expected Behavior
In other editors like SSMS (tested with SQL Server Management Studio 19), this code will have the proper syntax highlighting, and the second line will execute correctly.
Actual Behavior
Notepad++ doesn't escape the ', resulting in syntax highlighting breaking after that point in the file (in the above example, the third line will display incorrectly).
Debug Information
Notepad++ v8.4.9 (64-bit)
Build time : Jan 27 2023 - 03:11:16
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:[REDACTED].sql"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 21H2
OS Build : 19044.2604
Current ANSI codepage : 1252
Plugins :
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4)
First screenshot is Notepad++ (third line not displaying correctly)
Second is SSMS (displaying correctly)
The text was updated successfully, but these errors were encountered:
SciTE for SQL display this correctly, but not for MS SQL.
Here is what SciTE does with the OP's query when the MS SQL lexer is enabled (*1):
Now watch as I select "ordinary" SQL from the lexer menu:
(*1) Extract this archive, start SciTE, and open the *.tsql file: issue-13160.zip
The custom SciTE.properties will override any existing file mapping as long as it's in the same directory as the SQL script.
Description of the Issue
Apostrophes are not escaped in square brackets, resulting in the syntax highlighting for .sql files breaking.
Steps to Reproduce the Issue
The below code adds a column with an apostrophe in the name.
--alter table Default_Test_Table add [bad_column'] nvarchar NULL
update Default_Test_Table set [bad_column'] = 'asdf'
update Default_Test_Table set [bad_column''] = 'asdf'
Expected Behavior
In other editors like SSMS (tested with SQL Server Management Studio 19), this code will have the proper syntax highlighting, and the second line will execute correctly.
Actual Behavior
Notepad++ doesn't escape the ', resulting in syntax highlighting breaking after that point in the file (in the above example, the third line will display incorrectly).
Debug Information
Notepad++ v8.4.9 (64-bit)
Build time : Jan 27 2023 - 03:11:16
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:[REDACTED].sql"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 21H2
OS Build : 19044.2604
Current ANSI codepage : 1252
Plugins :
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4)
First screenshot is Notepad++ (third line not displaying correctly)
Second is SSMS (displaying correctly)
The text was updated successfully, but these errors were encountered: