Option to place Table names on the same line as the keyword
Currently, no matter what settings are applied, table names are always placed on a new line, for example:
SELECT
ID,
Thing
FROM
TableName
JOIN
OtherTableName
ON blah=moo
WHERE
something <> something else
My personal preference is for:
SELECT
ID,
Thing
FROM TableName
JOIN OtherTableName
ON blah=moo
WHERE something <> something else
Please can we have an option to achieve table names on the same line as their action (FROM / JOIN)
This feature is now included in the new SQL Prompt 8.0. For additional information see: http://documentation.red-gate.com/display/SP8/SQL+Prompt+8.0+release+notes
You can get the latest version of SQL Prompt from http://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for your help!
-
Michael commented
This doesn't fully work. It still puts the table name for an UPDATE query on the next line.
-
Anonymous commented
I downloaded SQL Prompt 7.3 beta and still don't see how to get the table name on the same line as the FROM. There are a lot of nice changes but that is the one thing that still really bothers my sense of using space efficiently. The table name on a line by itself looks very strange to my eye.
-
Michael Tillett commented
The same applies to the WHERE clause too, although that IS a "column", so I think additional option may be required.
-
Michael Tillett commented
This is a bug, no? The formatting states "Place the following on a new line: First column". The object following a FROM, is a table.
-
Anonymous commented
+1 Add my vote for a separate option for the location of the table name after the FROM. I don't want to have to fix the indent level and the first column name in order to have the table name on the same line as the FROM.
-
Barry Johnson commented
I would agree that this is a feature that should be included. Why would the placement of the table names be related to the placement of the first column in a select statement? This post was made in 2012, have Redgate taken the suggestion on board or is this never going to be an option?
-
Mohammad Mahdi Saffari commented
I have the same problem and I'm using the latest trial. I'd like to have these options too...
-
Paul White commented
+1 This is one of the main reasons I don't use this feature (as clarified by Alexander Harris).
-
AdminJustin Caldicott (Admin, Redgate) commented
Thanks for the clarification Alex. I think splitting that out would make the options clearer too.
Justin
-
Alexander Harris commented
Hi Justin, thanks for your comment.
I'm sorry not to have been more explicit. Yes, this option achieves the style I prefer, except that (being a strange and difficult user) I like my SELECT columns to start on a new line and my FROM / JOIN Table names to start on the same line. IE: That would mean splitting the option so that the SELECT behaviour was separate from the rest.
-
AdminJustin Caldicott (Admin, Redgate) commented
Hi Alex,
Thanks for your feedback.
Please take a look at Options -> Format -> Styles -> Data statements, and uncheck the "First column" box.
Unfortunately the option is slightly misleading, as it doesn't appear to affect just the first column, but the first item after each keyword, including table names after a FROM keyword.
Let me know if that helps you.
Justin