Unpredictable behavior of the following script :
SELECT * FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id2= t2.id2
sometimes it provides:
SELECT * FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id2 = t2.id2
sometimes:
SELECT * FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id2 = t2.id2
especially if it's inside brackets:
SELECT * FROM (table1 AS t1 INNER JOIN table2 AS t2 ON t1.id2= t2.id2)
settings was not changed during test.
I have tried for SSMS, java and Win app.
Could you please advise what can be wrong?
Thanks in advance
Of course my script is more complicated, and linebreaks do not work correctly only in Win app but fine in SSMS and java.
When I tried to simplify the example I found out the result is unpredictable.
I have found out why the result was different - because of "No breaks for SQL up to 80 Char.
However, my original issue still unresolved.
Win app does not formatted JOIN into brackets, java and SSMS do.
many thanks for your feedback.
You are totally correct. The option "No breaks for SQL up to 80 Char." is not available in all Apps.
And the SSMS App is runnung with the Parser Release 5
Recently I created a new parser Release 6 and it looks like I need to add a parsing rule for JOIN in brackets.
Regards
Guido
@idol is the SQL with the JON inside brackets syntactically correct? If yes, for which dB?
syntax is correct, it's SQL server.