Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Option to normalize casing of identifiers in the ScriptGenerator

Open
#177 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
sql
Domain
databases

Research direction

Start by locating the ScriptGenerator and its current settings, then trace how identifiers are emitted in generated SQL. Resolve whether casing applies uniformly or needs separate instance-level and database-level settings; done means PreserveOriginal remains the default and LowerCase and UpperCase use invariant casing as specified.

Written by the indexing model from the issue text.

Description

formatting

SQL Server compares identifiers with respect to the CI/CS, AI/AS setting of the respective database's collation. While accent sensitivity has no effect on the SQL source code, case-sensitivity may have such an effect when the goal is to produce a 'canonical' form of the source code. The locale part of the collation plays no part in this.

Hence, the settings of the ScriptGenerator should be extended with an option to normalize casing of identifiers as follows:

  • PreserveOriginal — outputs identifiers as-is; this shall be the default behavior corresponding to the current state (no breaking change)
  • LowerCase — lower-case all identifiers when producing the output
  • UpperCase — upper-case all identifiers when producing the output

A simple ToLowerInvariant() / ToUpperInvariant() should be used.

Question is, whether the ScriptGenerator should support separate settings for instance-level (global) objects versus objects in a database. This would significantly increase the complexity. See also Database identifiers:

The collation of an identifier depends on the level at which it's defined. Identifiers of instance-level objects, such as logins and database names, are assigned the default collation of the instance. Identifiers of objects in a database, such as tables, views, and column names, are assigned the default collation of the database.

Dominant language
GAP
Stars
277
Forks
43
Avg merge
6d 17h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/SqlScriptDOM

All issues in microsoft/SqlScriptDOM

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.