Delimit/Undelimit Identifiers
Introduction
Section titled “Introduction”Refactor commands for delimiting not delimited identifiers with square brackets and undelimiting all not delimited identifiers in the document or current selection.
Delimit identifiers command usage
Section titled “Delimit identifiers command usage”The command ensures that all SQL statements have the semicolon statement terminator at the end.
Input sql script:
CREATE TABLE Employee(EmployeeID int IDENTITY (1,1) NOT NULL,FirstName varchar(30),LastName varchar(30))Result:
CREATE TABLE [Employee]([EmployeeID] int IDENTITY (1,1) NOT NULL,[FirstName] varchar(30),[LastName] varchar(30))Undelimit identifiers command usage
Section titled “Undelimit identifiers command usage”The command removes delimiters of the identifiers that comply with the rules for the format of regular identifiers.
Input sql script:
SET QUOTED_IDENTIFIER ONgoCREATE TABLE [Employee]]]([EmployeeID] int IDENTITY (1,1) NOT NULL,[First Name] varchar(30),[LastName] varchar(30),"DeptID" int)Result:
SET QUOTED_IDENTIFIER ONgoCREATE TABLE [Employee]]](EmployeeID int IDENTITY (1,1) NOT NULL,[First Name] varchar(30),LastName varchar(30),"DeptID" int)