How is SQL Prompt helping your team? Share your experience.

Is it possible to align a subquery with other items?

I have a piece of SQL.

SELECT *
FROM sys.dm_db_index_physical_stats(
         DB_ID(),
         OBJECT_ID(N'Sales.SalesOrderDetail'),
     (SELECT CAST(index_id AS INT)FROM sys.indexes WHERE name = 'IX_SalesOrderDetail_ProductID'),
         DEFAULT,
         N'DETAILED'
     );

I've enabled the "indent list items" setting. But it seems that `(SELECT CAST(index_id AS INT)FROM sys.indexes WHERE name = 'IX_SalesOrderDetail_ProductID'),` is not considered as an item. See below image. This formatting is a little weird to me. Is it possible to align `(SELECT CAST(index_id AS INT)FROM sys.indexes WHERE name = 'IX_SalesOrderDetail_ProductID'),` with other items (basically make it an item too)? 

Thanks.



Tagged:

Answers

  • Hello,

    Thank you for your inquiry into SQL Prompt.

    It should be possible to align the parentheses section of the provided SQL Query by selecting one of the other options under Global > Parentheses.

    The image below shows my current settings and alignments.



    I hope this information helps.

    Best,

    Dustin 
Sign In or Register to comment.