Hi @Eshwar Nakkala ,
You can format SQL code using SQL Server Management Studio (SSMS) native options or format SQL code using a third-party SQL formatter tool.Please refer to this link:How to format SQL code in SQL Server Management Studio
You can also use a SSMS plugin called Poor Man’s T-SQL Formatter for formatting SQL statements and procedures.
Installing And Using Poor Man’s T-SQL Formatter
- Download the Poor Man’s T-SQL Formatter plugin from http://architectshack.com/PoorMansTSqlFormatter.ashx.
- Double click the downloaded msi file and install it.
- Now, launch the SSMS. Either select a statement to format only a specific statement in the document, or do not select anything, if you want to format the content of whole document.
- Go to Tools on menu and select Format T-SQL Code. The T-SQL code will be formatted.
For more details, please refer to:
Formatting SQL Statements In SSMS
If you have any question, please feel free to let me know.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.