SQL Complete - strange one-liner

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
riska
Posts: 2
Joined: Wed 06 Jul 2016 11:23

SQL Complete - strange one-liner

Post by riska » Wed 06 Jul 2016 11:30

Hi guys, do you have any idea how to setup profile when I want to keep one liners in select list without the change? Below example speaks for itself:
I have this code:
SELECT MyId = ROW_NUMBER() OVER (ORDER BY ( SELECT 1))
FROM table

formatting changes this to the following:
SELECT MyId = ROW_NUMBER() OVER (ORDER BY
(
SELECT
1
)
)
FROM table

In General setting I have margin set to 250.
As you can see a simple one-liner pretty damages readability and looks very strange.

Thanks :)

alexa

Re: SQL Complete - strange one-liner

Post by alexa » Wed 06 Jul 2016 13:54

Please perform the following:

1. Select 'SQL Complete -> Options...' from the main menu. The 'Options' window opens.
2. Navigate to the 'Formatting -> Profiles' branch.
3. Select the active profile.
4. Click 'Edit Profile...'. The 'Edit Profile' window opens.
5. Expand the 'SELECT -> Select List' node.
6. Unselect the 'Line break before first column' option.
7. Expand the 'Subquery' node.
8. Unselect the 'Use same formatting as in SELECT' option.
9. Unselect the 'Line break before open brace' option.
10. Unselect the 'Line break after open brace' option.
11. Unselect the 'Line break before closing brace' option.
12. Unselect the 'Line break after closing brace' option.
13. Unselect the 'Select List -> Line break before first column' option.
14. Click 'OK'.

If this still doesn't help, please send your formatting profile along with the screenshots of the actual and expected formatting to our support system at supportATdevartDOTcom

riska
Posts: 2
Joined: Wed 06 Jul 2016 11:23

Re: SQL Complete - strange one-liner

Post by riska » Wed 06 Jul 2016 14:07

Thanks Alexa, that helped. This looks better now.
However large subqueries are not visibly separated by brackets. Having large subquery with visible brackets helps to quickly see the end of this subquery such as below
SELECT
columns
FROM
(
subquery
) mysubquery
Above I can clearly start and end of this large subquery by identifying rows with brackets.

alexa

Re: SQL Complete - strange one-liner

Post by alexa » Fri 08 Jul 2016 13:13

We have put this to our roadmap for the next product versions.

Post Reply