Competition: What’s your favorite Redgate tool? Enter now.

SQLPrompt 7.3.437 question

JimFJimF Posts: 49 Bronze 3
edited August 25, 2016 9:07AM in SQL Prompt
I am trying out the formatting in 7.3.437 (and yes, I know it's pre-release, so these may be on your list...), but I have two things so far.

If these options exist already, just let me know where I missed them.

1) I was trying to format an INSERT... VALUES... statement and I can't get the parens in the VALUES clause to align other than full left relative to the INSERT.

I have
Insert Into enr.UploadFileLayoutColumn
     (UploadFileLayoutRecordId,
      ColumnNumber,
      ColumnLength,
      UploadColumnNameId
     )
Values
(25,   -- UploadFileLayoutRecordId - int
 2,    -- ColumnNumber - int
 Null, -- ColumnLength - int
 6     -- UploadColumnNameId - int
)
But I would like to see
Insert Into enr.UploadFileLayoutColumn
     (UploadFileLayoutRecordId,
      ColumnNumber,
      ColumnLength,
      UploadColumnNameId
     )
Values
     (25,   -- UploadFileLayoutRecordId - int
      2,    -- ColumnNumber - int
      Null, -- ColumnLength - int
      6     -- UploadColumnNameId - int
     )
and maybe even an option to indent the VALUES clause too!

2) I would like to see the "CREATE TABLE" options applied to variable tables too (or an option to allow it). For example:
Declare @Temp table
      (TempId int,
       AMuchLongerName varchar(10)
      )
Then becomes
Declare @Temp table
      (TempId          int,
       AMuchLongerName varchar(10)
      )
Thanks for a great product and keep up the good work!
Jim

Comments

  • Hi Jim

    Thanks for the feedback, they're both great suggestions and we'll take a look at implementing them now.

    Thanks
    Ali
  • JimFJimF Posts: 49 Bronze 3
    Thanks Ali,

    One more thing (I can open a new thread, if you wish). "GO" seems to always be adding a blank line after it. Is there a way of turning that off? Normally, I wouldn't care, but with things like Stored Procs, UDFs, triggers, etc., I like to keep it clean with no extra space at the top. Now, I would not expect you to conditionally add the new line, so an option to turn that off globally would be fine.
    Set Ansi_Nulls On
    Go
    Set Quoted_Identifier On
    Go -- I don't want this blank line after the "GO", please!
    
    -- =============================================
    -- Author:		Jim 
    -- Create date: 12/15/2015
    -- Description:	Logs a run-time error message for later tracking
    -- =============================================
    Alter Procedure dbo.Misc_AddError @UserId      varchar(50)  = Null,
                                      @MachineName varchar(30)  = Null,
                                      @Source      varchar(50)  = Null,
                                      @Message     varchar(Max) = Null
    As
        Begin
            Set NoCount On;
            Set Xact_Abort On;
    
        -- Blah, blah, blah...
        End
    
  • Hi Jim

    We’ve just released a new beta which should fix two of your issues:
    CREATE TABLE formatting options are now applied to variable table declarations.
    An empty line is no longer inserted after GO statements.

    You can download the latest version from here.

    Please let me know if the fixes don’t work as you expect. The VALUES clause alignment has taken longer as it's a bit more complex (but we do intend to fix it in a future version).

    Thanks
    Ali
  • Hi Jim

    We’ve just released a new beta which should fix the VALUES clause alignment issue. You can download it from here.

    Again, please let me know if it doesn’t work as you’d expect.

    Thanks
    Ali
Sign In or Register to comment.