Skip to content

Formatting nvarchar strings for SQL Server causes errors in query #41

@JakubOr

Description

@JakubOr

Formatting a query containing nvarchar string for SQL Server e.g. N'string' causes it to change to N 'string' which is considered an error in query.

Longer example:

USE [DATABASE]
GO
INSERT INTO [SCHEMA_DIGIT].[TABLE_table] ([COLUMN_1], [COLUMN_2], [COLUMN_3]) VALUES (N'Value1', N'ALongValueHereNotSureWhy', N'Value3');

Turns into:

USE [DATABASE]
GO
INSERT INTO
    [SCHEMA_DIGIT].[TABLE_table] ([COLUMN_1], [COLUMN_2], [COLUMN_3])
VALUES
    (
        N'Value1',
        N 'ALongValueHereNotSureWhy',
        N'Value3'
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions