Would it be possible to make the SQL Format available via an CLR function on the sql server
Comments
5 comments
-
Thank you for your post, Are you able to clarify your feature request? Are you referring to the custom formatting styles in SQL Prompt?
-
When in a query window, we can right click and choose Format SQL.
There is a bulk method shown here: https://www.red-gate.com/hub/product-learning/sql-prompt/bulk-formatting-of-the-sql-server-sql-files. "i would prefer if i could stay in code"
So what I would like to have is a CLR function where I could do the same, like:
SELECT [master].[redgate].format_sql(@expression, @style, ... ) -
Hi @PawJ,
The bulk formatting commands and bulk code analysis are available in the SQL Prompt menu as seen here:
https://documentation.red-gate.com/sp/features-available-only-in-sql-toolbelt-essentials-and-sql-toolbelt/bulk-operations/bulk-operations-in-ssms/bulk-formatting
-
Hi Ben
But it wasn't what I asked for!
I requested a CLR function to prepare scripts using a function.
However, you are asking me for the following:- Export my code to a file
- Starting the application up and bulk format the folder
- Importing the formatted code file
- Saving the script..
This appears to be quite thorough.
But it's fine if you don't see the use case and decide not to implement this functionality...
-
Hi @PawJ
Sorry, I misunderstood the request. This isn't something that the team are currently looking into, but if this is a feature that you'd like to see in the future, then you can post your suggestion to our UserVoice forum below:
https://redgate.uservoice.com/forums/94413-sql-prompt
Add comment
Please sign in to leave a comment.