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).
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.