What are the challenges you face when working across database platforms? Take the survey
Options

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

ogrishmanogrishman Posts: 81 Bronze 4
edited December 2, 2014 9:23AM in SQL Prompt
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.

Comments

  • Options
    Aaron LAaron L Posts: 596 New member
    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.
  • Options
    ogrishmanogrishman Posts: 81 Bronze 4
    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?
  • Options
    Aaron LAaron L Posts: 596 New member
    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
  • Options
    Aaron LAaron L Posts: 596 New member
    We've just released 6.4.1 which should now have a fix for this.

    Thanks,
    Aaron.
Sign In or Register to comment.