SQL identifiers and formats

Source: Internet
Author: User

The database name is an identifier, and the table name is an identifier, and the identifiers in SQL Server are divided into two categories:
(1). General identifier; (2). Delimited identifier
Important difference between the two: the regular identifiers must strictly abide by the naming rules, and the delimited identifiers can not follow the naming provisions, as long as the [], "" separated out can be.
"Format

A, the first letter of the identifier: must be so the Uniform Code standard of the characters, including 26 English letters A~Z and A~z, as well as some language characters, such as Chinese characters. or underline "_" "@", "#".

B. The character after the first letter of the identifier: so the characters specified in the Uniform Code standard, or 26 English letters A~Z and a~z, and some other language characters, such as Chinese characters. Also included are some special symbols such as underscore "_", "@", "#", "$", and 0,1,2,3,4,5,6,7,8,9.

C, identifiers are not allowed to be reserved keywords in the SQL Server system. Because the uppercase and lowercase letters are not case-sensitive in SQL Server, they are not allowed, whether they are retained in upper case or in lower case.

For names that do not satisfy a rule identifier, they need to be identified with a delimiting symbol. (Note: cannot be identified casually.) such as (Em[ploy]ee) this is wrong)

D, some special symbol identifiers in SQL Server also have a specific meaning, and can not be arbitrarily defined.

such as # begins with a temporary table in the current database.

and # #开头的是全局的数据库的对象.

If the server is disconnected or restarted, the data is automatically deleted.

SQL identifiers and formats

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.