Page 1 of 1
Indenting code between BEGIN & END statements
Posted: Tue 21 Aug 2012 17:38
by rahulgarg7
Hello, I have a couple of questions:
1) Do all the SQL complete settings get saved in the vssettings file maintained by SSMS or is there some separate file?
2) I was wondering if there was some option to indent the code between the BEGIN & END statements.
for eg, this is how I would expect to see all statements between the begin and end blocks below (please ignore that I'm using just select statements here).
Code: Select all
BEGIN TRY
SELECT *
FROM Categories
SELECT *
FROM Customers
SELECT *
FROM Orders
END TRY
BEGIN CATCH
PRINT 'error'
END CATCH
But when I format using SQL complete, this is how the sql gets formatted:
Code: Select all
BEGIN TRY
SELECT *
FROM Categories
SELECT *
FROM Customers
SELECT *
FROM Orders
END TRY
BEGIN CATCH
PRINT 'error'
END CATCH
Not really a biggie but is there some setting for this or is this something not possible to do using the various formatting options in SQL complete?
Re: Indenting code between BEGIN & END statements
Posted: Wed 22 Aug 2012 10:42
by alexa
1) Do all the SQL complete settings get saved in the vssettings file maintained by SSMS or is there some separate file?
SQL Complete settings are saved into a separate *.settings file. Please refer to the 'Import and Export Settings' node in dbForge SQL Complete Help documentation.
2) I was wondering if there was some option to indent the code between the BEGIN & END statements.
You could setup SQL Complete as below:
1. Select 'SQL Complete -> Options' from the main menu. The 'Options' window opens.
2. Navigate to the 'Formatting -> Indentation' branch.
3. Select the 'Indent block contents' option under the 'Code' node.
Re: Indenting code between BEGIN & END statements
Posted: Fri 24 Aug 2012 16:46
by rahulgarg7
thanks for your response Alexa. Sorry for not replying earlier... I thought I would get some email notification when someone replied (but it seems I need to check the box specifically for that to happen...usually that is the default so I missed it).
Re: Indenting code between BEGIN & END statements
Posted: Fri 02 Aug 2013 13:45
by Chris123
Hi Alexa,
I have just updated to 4.0.89.1 of the Express Edition and this option seems to have disappeared from Formatting. I could not see a way of doing it in the Profiles settings either.
Can you please explain how BEGIN END block indenting can be achieved?
Thanks,
Chris
Re: Indenting code between BEGIN & END statements
Posted: Mon 05 Aug 2013 07:42
by alexa
Unfortunately, this feature is not available in the Express edition of dbForge SQL Complete. Therefore, we would recommend you to download a free trial version where all features are implemented in full:
http://www.devart.com/dbforge/sql/sqlco ... nload.html
Re: Indenting code between BEGIN & END statements
Posted: Fri 25 Oct 2013 21:17
by BradGreer
alexa wrote:Unfortunately, this feature is not available in the Express edition of dbForge SQL Complete. Therefore, we would recommend you to download a free trial version where all features are implemented in full:
http://www.devart.com/dbforge/sql/sqlco ... nload.html
I can appreciate not supporting some features in a free version. But could you please stop provide negative support for block formatting. If you don't support formatting in some context, just leave it alone rather than shoving it to the left margin and destroying my hard work of manual formatting. Destroying my formatting does not garner my respect or motivate me to pay you.