Beta: Format SQL may remove too many double quotes

JimFJimF Posts: 48 Bronze 2
edited September 12, 2014 4:12AM in SQL Prompt
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)
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

Sign In or Register to comment.