Options

suggestion - sql promt edit style for Parenthesis should allow one more style

would it be possible to add one more style to the edit style page for Parentheses?  I would like the inline ( but have the sql code indented.  for example:
    select top 1 name
    from production.product product
    where p.id>20
    order by modifiedDate
);

I use sub queries fairly often and I always indent the text of the sub-query like this and its the one option you don't allow though it seems extremely obvious
Tagged:

Answers

  • Options
    the same would be true for indenting the content of the schema:

    CREATE TABLE Production.BillOfMaterials (
        BillOfMaterialsID INT IDENTITY(1, 1) NOT NULL PRIMARY KEY NONCLUSTERED(BillOfMaterialsID ASC)
        ,ProductAssemblyID INT NULL
        ,ComponentID INT NOT NULL
        ,UnitMeasureCode NCHAR(3) NOT NULL FOREIGN KEY REFERENCES UnitMeasures(ID, Code)
    ) ON [PRIMARY]

    GRANT EXECUTE ON LogEvent TO ts_webapplication;

    ALTER AUTHORIZATION
    ON OBJECT::Production.ProductionView006
    TO SCHEMA OWNER;
  • Options
    Also the CTE statement formatting:  Put the parenthesis inline with the first statement, closing paren on a new line but indent the contents from the left edge
  • Options
    Hi @shawndevin

    Thanks for reaching out to us regarding this.

    Regarding the first example, I think I've been able to achieve what you are after with the example statement you provided.

    Under Parentheses, I selected the 5th style (the last style on the top line) and checked 'Indent parentheses contents'. Also, just to mention, I had to ensure 'Place DISTINCT/TOP clause on new line (under Data (DML) was unchecked to stop 'name' going onto a new line.  Having these formatting settings in place made the example statement look as required.

    Regarding indenting the content of the schema and the CTE statement formatting, I've not been able to find a way to do either of these so far.

    I wondered, would it be possible for you to provide you style file? That way I can use it to further test this.
    Kind regards

    Dan Jary | Redgate Software
    Have you visited our Help Center?
Sign In or Register to comment.