These pages cover SQL Prompt 7, which is not the latest version. Help for other versions is also available.
Applying casing options
Published 20 January 2014
You can use SQL Prompt to change the case of keywords (eg SELECT
), built-in functions (eg COUNT()
), and built-in data types (eg int
) in a SQL script.
For example, the following SQL:
- declare @dateOnly datetime
- set @dateOnly = cast(floor(cast(getdate() as float)) as datetime)
can be modified to:
- DECLARE @dateOnly datetime
- SET @dateOnly = Cast(Floor(Cast(GetDate() AS float)) AS datetime)
To specify the casing you want to use:
- On the SQL Prompt menu, click Options.
- Under Format, select Case.
- Use the drop-down menus to select the case to use for keywords, functions and data types:
To apply casing options:
- Open the script you want to modify in a SQL Server Management Studio query window.
- If required, select a portion of SQL in the script that you want to apply casing options to.
On the SQL Prompt menu, click Apply Casing Options.
You can also hold Ctrl and press B then U to apply casing options.