First look at the following SQL statements
Code
1 Set quoted_identifier on
2 select * from "user" where a = 'netasp'
3
4 set quoted_identifier on
5 select * from [user] Where a = 'netasp'
6
7 set quoted_identifier off
8 select * from [user] Where a = "netasp"
9
10 set quoted_identifier off
11 select * from [user] Where a = 'netasp'
When you create a table named "user" in the database, it is often troublesome because the user is a keyword in SQL, but the preceding statements do not report an error. Let's talk about another concept:The identifier is the brackets [] in SQL.
When the set quoted_identifier value is on, the characters in double quotation marks are treated as database objects. That is to say, double quotation marks "" and identifiers [] have the same effect. They all indicate that the referenced characters are database objects. Single quotation marks (') indicate the boundary of a string.
When set quotde_identifier off, double quotation marks are interpreted as string boundary, which is similar to single quotation marks. Double quotation marks cannot be used as identifiers, but can be used as character boundary. They have the same effect as single quotation marks.
A summary can be made: When set quoted_identifier on "" is equivalent to [], it indicates the database object; when set quoted_identifier off "" is equivalent to '', it indicates the string boundary; the double quotation marks here are not combined by two single quotation marks. They are produced by SHIFT +. Beginners may make such mistakes.