How can we help you today? How can we help you today?

(un)Indent the body of a store procedure of function

I have the following code:
CREATE PROCEDURE dbo.test
    @test1 NVARCHAR(MAX) = 'All',
    @test2 NVARCHAR(MAX) = 'All'
AS
    BEGIN
        SET NOCOUNT ON;
    END
    GO

Is there a way to *not* indent the BEGIN ... END block?
Also I want to know if it's possible to move all GOs to the beginning of the line?

Thanks.
ogrishman
0

Comments

4 comments

  • Aaron L
    Hi ogrishman,

    The indentation of this can be toggled through Format->Schema statements->Indent contents. For the GO indentation that's something that the current formatting system doesn't change but it should be supported in the system which'll be in v7.

    Thanks,
    Aaron.
    Aaron L
    0
  • ogrishman
    Thanks.

    When I check "Indent Contents", the "Sample SQL" actually indents the contents, but the "Current Query" does not get indented.
    In order to indent my code, I have to uncheck "Indent Contents". That's a little confusing. Is this a bug?
    ogrishman
    0
  • Aaron L
    That does sound like a bug - I'll have a look into seeing if I can recreate it and find out what's happening.

    Thanks,
    Aaron.

    Edit: I can recreate this here and should have a fix for you in our 6.4.1 release next week
    Aaron L
    0
  • Aaron L
    We've just released 6.4.1 which should now have a fix for this.

    Thanks,
    Aaron.
    Aaron L
    0

Add comment

Please sign in to leave a comment.