Beta: Format SQL may remove too many double quotes
JimF
Posts: 49 Bronze 3
I just got some SQL from an associate that they asked me to review. Of course the first thing I did was reformat the SQL, and it broke the SQL. The SQL was similar to this (more complicated, but this demonstrates the issue)
When I reformat it, it becomes this
Now, I would be the first to admit that this isn't exactly the brightest choice of table names and/or aliases, but it is from an old legacy system that generates SQL and it has been slated for replacement...
But, that said, I think you may want to know of the potential problem in that now that the quotes are gone from "Grant" the SQL will not execute (Incorrect syntax near the keyword 'Grant'.)
Personally, this is not a big issue for me, just wanted you to know about it.
Select "Grant"."GrantID", "Grant"."GrantType" From [Grant] AS [Grant]
When I reformat it, it becomes this
Select Grant.GrantID, Grant.GrantType From [Grant] As [Grant]
Now, I would be the first to admit that this isn't exactly the brightest choice of table names and/or aliases, but it is from an old legacy system that generates SQL and it has been slated for replacement...
But, that said, I think you may want to know of the potential problem in that now that the quotes are gone from "Grant" the SQL will not execute (Incorrect syntax near the keyword 'Grant'.)
Personally, this is not a big issue for me, just wanted you to know about it.
Comments
I think I can recreate it here and will look into a fix for you later today.
Update: this should now be fixed in 6.4.0.622