Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New TSQL rule suggestion: Flag statements that do not end with semi-colon #1748

Closed
jpers36 opened this issue Oct 25, 2021 · 0 comments · Fixed by #1902
Closed

New TSQL rule suggestion: Flag statements that do not end with semi-colon #1748

jpers36 opened this issue Oct 25, 2021 · 0 comments · Fixed by #1902
Labels
enhancement New feature or request new rule A new linting rule to add to the library t-sql Issues related to the T-SQL/TSQL/Transact SQL dialect

Comments

@jpers36
Copy link
Contributor

jpers36 commented Oct 25, 2021

The semi-colon statement terminator is optional but best practice.

This could be fixed automatically.

Anti-pattern:

SELECT 1

Pattern:

SELECT 1;

This could potentially apply to other dialects as well; I am not familiar enough with other dialects to say for sure.

An exception to the above rule would be the BEGIN statement, where we should flag/remove the optional semi-colon if we see it.

@jpers36 jpers36 added the enhancement New feature or request label Oct 25, 2021
@tunetheweb tunetheweb added new rule A new linting rule to add to the library t-sql Issues related to the T-SQL/TSQL/Transact SQL dialect labels Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new rule A new linting rule to add to the library t-sql Issues related to the T-SQL/TSQL/Transact SQL dialect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants