Sql-server – How to make SSMS upper case keywords

sql serversql-server-2012ssms

I recently started using Management Studio 2012. When using MySQL Workbench, a handy feature was that I could stay all in lower case and any reserved word (like SELECT, INSERT) would convert to upper case automatically. How do I replicate this behavior in SSMS?

Best Answer

No, Management Studio does not have this native functionality in any version from 2005 -> 2016 CTP 3.2. You may want to check out 3rd party add-ins, like Mladen Prajdić's SSMS Tools Pack or Red-Gate's SQL Prompt, both of which have the capability to format a block of code, including automatically upper-casing keywords. However I don't know of any tool that will do this automatically as you type.

For me, I have been doing it so long, it just comes naturally, and not pressing Shift would actually slow me down. When I get someone else's code where the keywords are lower case, I highlight either the whole block or the offending sections, and hit Ctrl+Shift+U. If I have to highlight the whole section, I then go in to the object / column names and use IntelliSense to case them correctly (I have a real hang-up about ensuring that all keywords are upper case and all entity names match the metadata exactly, because you never know when your code will be deployed to a case sensitive collation).