SQL Format as CLR function
PawJ
Posts: 12 Bronze 1
in SQL Prompt
Would it be possible to make the SQL Format available via an CLR function on the sql server
Tagged:
Best Answer
-
Ben_P Posts: 233 Silver 2Hi @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
Answers
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, ... )
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
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:
But it's fine if you don't see the use case and decide not to implement this functionality...