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

Could you help to confirm if this is a formatting bug?

I have a piece of code:
DECLARE @orders TABLE(order_id BIGINT NOT NULL UNIQUE WITH(IGNORE_DUP_KEY=ON))

When I format it, it changed to:
DECLARE @orders TABLE (   order_idBIGINTNOTNULL
                              UNIQUE
                              WITH (IGNORE_DUP_KEY = ON)
                      );

Note the order_id and its type connected together. Can anyone help me to confirm please? I'm using the most recent version of SSMS and SQL Prompt.
ogrishman
0

Comments

4 comments

  • Dan B
    Hi ogrishman,

    Thanks for posting on the Redgate forums.

    Can you check if you have the 'Use new formatting styles' option selected? You can check this via SQL Prompt>Options>Experimental Features then the bottom tickbox is 'Use new formatting styles'.

    If you have this turned on can you turn it off and test again?
    Dan B
    0
  • ogrishman
    Yes it was checked. When I disable the new formatting, I can format the code correctly and it was formatted to:
    DECLARE @orders TABLE
        (
          order_id BIGINT NOT NULL
                          UNIQUE WITH ( IGNORE_DUP_KEY = ON )
        );
    

    When I switch back to new formatting, it still format the code as I mentioned before.
    ogrishman
    0
  • Harry Frankish
    Hi ogrishman

    Thanks for reporting the issue. Yes, this is a bug in the new formatting feature. We've reproduced it here and can start working on a fix.

    Many thanks
    Harry
    Harry Frankish
    0
  • Dan B
    Hi ogrishman,

    Thanks for your patience with this. We have fixed this bug in SQL Prompt version 8 which can be downloaded from here

    ftp://support.red-gate.com/patches/SQLPrompt/24May2017/
    Dan B
    0

Add comment

Please sign in to leave a comment.