WHERE clause allignemnt with multiple levels
wolfixx
Posts: 6 Bronze 1
in SQL Prompt
Hi,
This is the WHERE part of a query after I applied SQL Prompt formatting.
As you can see when I add a sub level after AND with 2 opening brackets they appear on the same level
....
Ideally the code should look liek this:
Is this possible with SQL Prompt?
Thanks,
Wolfgang
This is the WHERE part of a query after I applied SQL Prompt formatting.
As you can see when I add a sub level after AND with 2 opening brackets they appear on the same level
....
WHERE ExportWorkspacePathRank = 1 --New documents or updates detected AND ( ( SELECT COUNT(*) FROM DocumentList WHERE ExportChangeDeteched = 1 ) > 0 OR --Document deletes detected ( SELECT COUNT(*) FROM DocumentList ) < ( SELECT COUNT(*) FROM dbo.ExportDocuments WHERE ExportID = ( SELECT MAX(ExportID) FROM dbo.ExportDocuments ) ) );
Ideally the code should look liek this:
WHERE ExportWorkspacePathRank = 1 --New documents or updates detected AND ( ( SELECT COUNT(*) FROM DocumentList WHERE ExportChangeDeteched = 1 ) > 0 OR --Document deletes detected ( SELECT COUNT(*) FROM DocumentList ) < ( SELECT COUNT(*) FROM dbo.ExportDocuments WHERE ExportID = ( SELECT MAX(ExportID) FROM dbo.ExportDocuments ) ) );
Is this possible with SQL Prompt?
Thanks,
Wolfgang
Tagged:
Comments
There isn't a way to do this at the moment, I'm sorry to say, but can you please post a request for this to our UserVoice forum: https://redgate.uservoice.com/forums/94413-sql-prompt?
Thank you!
Fabiola
SQL Prompt 8.1 has now the options I was looking for !!!!
Well done !!!