The Add or remove backticks for identifiers feature enables you to add or remove backticks for identifiers within the current SQL document or a selected code block, without changing their case. This feature doesn’t affect text in strings (' '), quotes (" "), or comments (--, /* */). It also doesn’t change the original identifier case.
You can add backticks to all identifiers in one of these ways:
Tip
To undo the change, press Ctrl+Z. The script returns to its previous state, and the cursor position remains unchanged.
You can remove unnecessary backticks from all identifiers in one of these ways:
Note
Remove Unnecessary Backticks doesn’t affect identifiers that:
- Contain spaces.
- Contain special symbols, for example,
@,$, or%.- Match the keywords, for example,
SELECTorFROM.
The following script shows identifiers before backticks are added:
SELECT a.actor_id,
a.first_name,
a.last_name,
a.last_update
FROM `actor` a;
SET @SQL_QUERY = 'SELECT first_name, `last_name`
FROM customer WHERE customer.customer_id = 1;';
SELECT @SQL_QUERY;
CREATE TABLE `SELECT` (`ORDER` INT PRIMARY KEY, test VARCHAR(50));

After you use Add Backticks to All Identifiers, all applicable identifiers are enclosed in backticks automatically.
SELECT `a`.`actor_id`,
`a`.`first_name`,
`a`.`last_name`,
`a`.`last_update`
FROM `actor` `a`;
SET @SQL_QUERY = 'SELECT first_name, `last_name`
FROM customer WHERE customer.customer_id = 1;';
SELECT @SQL_QUERY;
CREATE TABLE `SELECT` (`ORDER` INT PRIMARY KEY, `test` VARCHAR(50));
