Format SQL to Match Object Case
If I had the table [Address] that had the columns StreetAddress1, StreetAddress2, City, State and ZipCode defined and the following existing code was formatted:
SELECT streetaddress1,
streetaddress2,
CITY,
zipcode
FROM [address]
I would like to see SQL Prompt match the case of the underlying object such that the results after formatting would be:
SELECT StreetAddress1,
StreetAddress2,
City,
ZipCode
FROM [Address]
This should apply to all underlying objects (procedures [name and parameters], tables [columns, index names (used in hints), etc., functions and views; and anything else I forgot). It should also apply to variables defined within a procedure (e.g. DECLARE @MyValue INT... SET @myvalue = 3. Subsequent SET/SELECT or other use of the variable should be formatted to match the case in the DECLARE statement so that the SET above would be formatted to SET @MyValue = 3).
![](https://secure.gravatar.com/avatar/cd20e1dac3522311521a6fabc78dafd5?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
This is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Doug commented
YIPEE! And it appears to work like a champ!
-
BlueCollarCritic commented
AMEN! This should be a relatively easy change ti impement since existing T-SQL objects about a DB schema already retruns case accurate info.