How to stop indent the BEGIN ... END block?

ogrishmanogrishman Posts: 81 Bronze 4
edited August 18, 2014 10:33PM in SQL Prompt
Hi there,

I want to know if it's possible to disable the indentation of the BEGIN ... END block. Below is a sample code to demo what I want.
USE master;
GO
IF DATABASEPROPERTYEX(N'testdb', N'Version') IS NOT NULL
BEGIN
    ALTER DATABASE testdb SET OFFLINE WITH ROLLBACK IMMEDIATE;
    DROP DATABASE testdb;
END

Thanks.

Comments

  • Aaron LAaron L Posts: 596 New member
    Hi ogrishman,

    I don’t think this is exposed in the UI but you can change this by editing the following file:
    %localappdata%\Red Gate\SQL Prompt 6\RedGate_SqlPrompt_Format_Layout_LayoutOptions.xml
    
    And setting <IndentBeginToken> to False.

    I'm really sorry this is such an awkward way of setting what should be a common option. I don't know why it isn't in the UI so I'll have a look into seeing if we can put in an extra checkbox for it now.

    Thanks,
    Aaron.
  • Eddie DEddie D Posts: 1,803 Rose Gold 5
    Hi ogrishman,

    A support call has been created for you HERE. You will require a RedgateID to be able to view the support call via your web browser.

    Via our call logging system, I have set to you an email with a SQL Prompt Style attached where the indent value has been set to zero. Otherwise all other options are as per the default style. To import the style, please follow the advice in this Help ARTICLE.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Aaron LAaron L Posts: 596 New member
    I've also exposed the option through the UI in our 6.4 beta which you can download from here.

    It's under Tabs & wrapping as "Indent BEGIN…END blocks":

    xxLssVS.png
  • ogrishmanogrishman Posts: 81 Bronze 4
    Thanks for adding the checkbox! I've tried the beta version and it works like a charm.
Sign In or Register to comment.