Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need a tool to automatically indent and format SQL Server stored procedures [closed]

In my current project I've been inherited with lots of long (1200+ lines) SQL Server stored procedures with some horrible indentation and formatting which makes them almost unreadable. Is there some tool that I can use to automatically format these and make them more readable? I don't want to go through it manually and indent it.

like image 253
Malik Daud Ahmad Khokhar Avatar asked Mar 26 '09 15:03

Malik Daud Ahmad Khokhar


2 Answers

Here's a couple -- no idea how well they work, unfortunately...

http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm (free)

http://www.sqlinform.com/ (free for personal use)

like image 173
mwigdahl Avatar answered Oct 26 '22 19:10

mwigdahl


Try using ApexSQL Refactor. It integrates into SSMS and it’s a free tool. Good thing about it is that it allows to save formatting options and share them with the team so all of you use the same settings for code.

like image 23
Kenneth Hampton Avatar answered Oct 26 '22 20:10

Kenneth Hampton