SQL Prompt Actions
Published 29 October 2019
When you run Format SQL, SQL Prompt can perform a number of refactoring actions, including inserting semicolons and qualifying object names.
You can choose the actions you want SQL Prompt to perform from SQL Prompt > Options > Format > Styles:
You can also perform the following actions without running Format SQL:
Apply casing options
Apply casing options will change the case of your keywords, built-in functions, built-in data types and global variables according to your active formatting style.
To apply casing options, from the SQL Prompt menu, click Apply Casing Options. Alternatively, use the keyboard shortcut Ctrl + B then Ctrl + U.
Insert semicolons
Insert semicolons will add any missing semicolons to SQL statements in your script.
To insert semicolons, from the SQL Prompt menu, click Insert Semicolons. Alternatively, use the keyboard shortcut Ctrl + B then Ctrl + C.
Expand wildcards
Expand wildcards will expand SELECT * and SELECT table.* statements so that they list all of the columns in the referenced tables.
To expand wildcards, from the SQL Prompt menu, click Expand Wildcards. Alternatively, use the keyboard shortcut Ctrl + B then Ctrl + W.
Qualify object names
Qualify object names will modify a SQL script so that all object names are qualified in the format:
owner.object
Column names are qualified in the format:
table.column
SQL Server name and database name qualifiers aren't added to the names.
To qualify object names, from the SQL Prompt menu, click Qualify Object Names. Alternatively, use the keyboard shortcut Ctrl + B then Ctrl + Q.
You can configure which objects will be qualified from SQL Prompt > Options > Inserted code > Qualification:
Add/remove square brackets
SQL Prompt can add square brackets around all identifiers or remove square brackets from all identifiers that don't need to be delimited.
To add or remove square brackets, from the SQL Prompt menu, click Add Square Brackets or Remove Square Brackets. Alternatively, use the keyboard shortcut Ctrl + B then Ctrl + B.