How to make SSMS uppercase keywords

512    Asked by ankur_3579 in SQL Server , Asked on Apr 24, 2021

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

Answered by Ankur vaish

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

SQL server uppercase conversion The syntax of the UPPER function is as simple as below: If the input string is NULL, the UPPER function returns NULL, otherwise, it returns a new string with all letters converted to uppercase. Besides the UPPER function, some database systems provide you with an additional function named UCASE which is the same as the UPPER function. It is “there is more than one way to do it”.



Your Answer

Interviews

Parent Categories