Setting the formatting style using a comment in the code
TampaCraig
Posts: 5 Bronze 1
in SQL Prompt
Hello,
I know how to use
this would be useful if you have different clients with different styles or if you have specific SQL scripts that need longer line-wrap values than others and you'd like to just set this in the file's comments and not have to remember to manually switch between active Styles every time.
If this is not currently available, it would be a great, possibly easy to implement, feature to add.
I know how to use
--SQL Prompt Formatting Offand
--SQL Prompt Formatting Onto tell SQL Prompt to stop and start formatting code, but I was wondering if there was perhaps a way to use a comment to indicate that I want SQL prompt to use a specific formatting style to be used for a file or block of code.
this would be useful if you have different clients with different styles or if you have specific SQL scripts that need longer line-wrap values than others and you'd like to just set this in the file's comments and not have to remember to manually switch between active Styles every time.
If this is not currently available, it would be a great, possibly easy to implement, feature to add.
Tagged:
Answers
Thanks for reaching out to us regarding this.
Yes, it is possible to specify a specific formatting style file, as described here: https://documentation.red-gate.com/sp/features-available-only-in-sql-toolbelt-essentials-and-sql-toolbelt/bulk-operations/bulk-operations-via-the-command-line#:~:text=--,-style,--s
Dan Jary | Redgate Software
Have you visited our Help Center?
--SQL Prompt Formatting On Style="Craig - Wide"
My apology for the delay in replying to you on this!
I'm going to run this by our development team today and come back to you on this.
Dan Jary | Redgate Software
Have you visited our Help Center?
I've spoken with our development team about this, as I suspected we are not aware of there being anything that enables you to chose a formatting style using a comment.
I appreciate this would be useful functionality for you and encourage you to log a feature request for this on our User Voice page for SQL Prompt: https://redgate.uservoice.com/forums/94413-sql-prompt
Dan Jary | Redgate Software
Have you visited our Help Center?