Fix SQL Case Formatting - Consistent Casing
I have been sent a large database schema create script from a legacy system.
The schema has been written in a case insensitive way.
So for example any variables in the stored procs in this create script have been written in multiple cases:
The database was originally hosted on a Latin1GeneralCIAS Collation at server and database level.
The new hosting environment has been set to Latin1GeneralCSAS at server level, making it case sensitive.
Although we can set the database to Latin1GeneralCI_AS to make it case insensitive the script itself uses the servers (case sensitive) scope to create the tables.
You've got a great feature to uppercase keywords. What I would like is some sort of feature to make the variable names consistent.
Visual Studio does this for VB.net and will keep the casing consistent.
This is included in SQL Prompt 6.4, which you can download from http://www.red-gate.com/products/sql-development/sql-prompt/
Eugene Niemand commented
I suggest looking at using SSDT. If you import your database into SSDT in Visual Studio there is an option to give you warnings for incorrect casing of object names. At least this will highlight them.