Description
The following T-SQL Code cause MSSQL extension to format SQL in bad way.
SET @SQL = 'if not exists(select 1 from sys.server_principals p with (nolock) where name = ''ABS' + @AssigneeName + ''')
begin
create login [DOMAIN' + @AssigneeName + '] FROM WINDOWS
EXEC sp_addsrvrolemember ''ABS' + @AssigneeName + ''', ''sysadmin''
end';
Steps to Reproduce
Just paste the problematic SQL to new T-SQL query file in VS Code
Affected Area
If you selected "Other", please describe the affected area
No response
Environment Information
VS Code: 1.130
MSSQL Extension: 1.44
OS: Windows 11 26200.8875
Confirmation
Description
The following T-SQL Code cause MSSQL extension to format SQL in bad way.
SET @SQL = 'if not exists(select 1 from sys.server_principals p with (nolock) where name = ''ABS' + @AssigneeName + ''')
begin
create login [DOMAIN' + @AssigneeName + '] FROM WINDOWS
EXEC sp_addsrvrolemember ''ABS' + @AssigneeName + ''', ''sysadmin''
end';
Steps to Reproduce
Just paste the problematic SQL to new T-SQL query file in VS Code
Affected Area
If you selected "Other", please describe the affected area
No response
Environment Information
VS Code: 1.130
MSSQL Extension: 1.44
OS: Windows 11 26200.8875
Confirmation