Skip to content

Provide an option in the SqlNNNScriptGenerator classes to preserve comments #20

@arvindshmicrosoft

Description

@arvindshmicrosoft

Is your feature request related to a problem? Please describe.
Some use cases for the Sql*ScriptGenerator classes are actually for code "pretty printing" / formatting. However, using Sql150ScriptGenerator to re-generate the SQL text when provided with an input TSqlFragment, leads to comments (single-line and multi-line) both being excluded from the output.

Describe the solution you'd like
Provide an PreserveComments property in SqlScriptGeneratorOptions with the default being true in the 160 version, and false in the 150 or lower versions for backward compat.

Describe alternatives you've considered
Token re-writing: substituting a faux print statement instead of the comment token is a crude workaround. It fails in case the comment is a trailing suffix of a line within a multi-line T-SQL statement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions