[SQL Sandbox] Automatically find reserved words if used as columns and [] them
sql-sandbox
Web icon
Forge component by Leonardo Fernandes
Application Type
Reactive
Service Studio Version
11.12.2 (Build 49949)
Platform Version
11.13.2 (Build 32392)

Hey,

This is more of a suggestion than a question, really.

It would be neat if when the SQL Sandbox generates SQL it would recognize reserved words in SQL and bracket them so the SQL works out the box (would just need to be a little bit smarter than it is today).

Example:

SELECT Tenant_Id, Id, Key, Binary, Description, UpdateDate
  FROM XXXX_BinaryResources

Should be 

SELECT Tenant_Id, Id, [Key], Binary, Description, UpdateDate
  FROM XXXX_BinaryResources

There are other examples than Key like "Order" and other reserved words that can be used as columns without issue, but SQL Sandbox does not know to bracket. I think bracketing EVERYTHING would make the SQL much less readable, so I suggest only to attack the reserved words.

I can see SQL Sandbox already recognizes the keywords as they're marked in blue, but that may use another mechanic to do that mark-up - that I didn't check.

Let me know what you think :)

Forgot to mention this is an issue if you have a simple static entities and you do a SELECT * FROM on it - so it's not just me creating stupid names for columns :)

SELECT Id, Label, Order, Is_Active
  FROM OSUSR_7tv_Test


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.