Alexiy
Alexiy

Reputation: 2030

Is there a way to automatically deny using sql reserved word for column name?

So, can it be done with specialised programs (like MySQL workbench) or do I have to write a function that checks the presence of reserved keywords in queries for naming and denies using them?

Upvotes: 1

Views: 44

Answers (2)

Mike Lischke
Mike Lischke

Reputation: 53347

There is no way to automatically reject such names. Instead you can only enforce a strict usage rule by running a checker over your database in a regular interval (e.g. on commit in a version control system) and reject a script if that doesn't conform to your set of rules.

Upvotes: 0

Your Common Sense
Your Common Sense

Reputation: 157892

Instead of denying you just have to properly format them. In mysql you have to use backticks around identifiers to avoid a confusion

Upvotes: 1

Related Questions