SQL Prompt API
I think having an API to format generated SQL scripts, whether it be from the SQL Compare API or another process like SMO objects, to able to apply the formats saved in SQL Prompt.
It would be great if you could let us know more about how you’d use a Prompt API / command line version of Prompt.
What problems are you having without it?
How are you getting around those?
How would this make your work better?
Adam Hafner commented
Being able to apply formatting to multiple .sql files without having to manually open it up, apply it and then save it. It would be a huge help with taking over old code. Same thing for code smells, etc. You can identify technical debt much easier if you have the ability to script it. We could also use it to apply formatting as part of our devops cycle to ensure that it is formatted in a specific way or that specific code smells aren't found.
I expand on this idea in this suggestion:
I like the idea, and I am happy to use an API if I have to, but I would prefer to have RedGate create a simple command line version of SQL Prompt just for formatting SQL files. Then we, as developers, don't have to re-invent the wheel a thousand times.
Morgan Yarbrough commented
This would be extremely useful. I currently use Poor Man's T-SQL formatter for API usage (http://poorsql.com/) and SQL Prompt within SSMS. The problem is these two formatters produce different results, which means each script gets 'changed' due to reformatting by a different formatter.
why is this not already there????????????????? it would be very helpful
It's a great idea! We have a wealth of existing T-SQL code developed by a variety of developers, and as a result, multiple formatting styles. It would be especially great if the formatting of table aliases could be applied to existing T-SQL in the same manner as is being done with newly inserted T-SQL code.
I couldn't agree more. We're automating as much of our SQL development process as possible and hoping developers format SQL is not as good as having an automated way of doing it.