在網路上找了找，有個方便的工具：Instant SQL Formatter
有提供 Desktop version, Add-In for SSMS, Add-In for VS or API
API就是利用網路連結到Instant SQL Formatter來處理。所以重點還是在前三項
因為我不只是用MS SQL，所以下載了Desktop Version來測試，以下就是展示畫面：
而作者也提供了免費申請的服務：GET SQL PRETTY PRINTER DESKTOP VERSION FOR FREE
To get a free license key, you can do one of the following:
- If you are a technical/software blogger or journalist willing to write us up (honest reviews are the most useful to us) email us a short blurb with the link to your blog and we'll send you a license, FREE of charge, so that you can evaluate sql pretty printer properly.
- If you are willing to demo SQL Pretty Printer to an audience of at least 15 people (at a user group, a conference, a BarCamp), email us your info and we'll give you two licenses, one for you to keep and one to give away at the event, FREE of charge.
- If you teach a high-school class, email us the name of your school and your class, plus the number of students in your class. We will send you a license for all of them.
- A note to university students and professors: we currently do not offer free licenses to universities, but we'll be happy to offer you an additional 50% off any orders of 10 or more licenses. Let us know if you're interested and we'll set up a discount code for you.
If you don't fit in any of the four buckets above, you can buy a single-user license of SQL Pretty Printer for Desktop for $50.
IMPORTANT: due to the large volume of requests we have been receiving lately, we cannot promise we'll answer every email. We try our best, but please be understanding if you don't hear back from us.
有更新的消息會再補充！ ^ ^
感謝作者送了Desktop Version license.