naming rules for SQL SERVER

Source: Internet
Author: User
Tags format sql
Server
There are two types of identifiers in SQL Server: One is the rule identifier (Regular identifer) and the other is the delimited identifier (delimited identifer).

Where the rule identifier strictly adheres to the relevant format of the identifier, it is not necessary to use delimiters for any rule operator in Transact_sql. For identifiers that do not conform to the identifier format, use the qualifier [] or '.

Identifier format:

1. Identifiers must be characters specified in the Uniform Code (UNICODE) 2.0 standard, as well as some other language characters. such as Chinese characters.

2, the character after the identifier can be (except the condition one) "_", "@", "#", "$" and numbers.

3, the identifier is not allowed to be Transact-SQL reserved words.

4. No spaces and special characters are allowed within the identifier.

In addition, some identifiers that start with a special symbol have a specific meaning in SQL SERVER. An identifier that begins with "@" indicates that it is a local variable or an argument to a function; an identifier that begins with a # indicates that it is a temporary table or a stored procedure. The beginning of "# #" indicates that this is a global temporary database object. The global variables of Transact-SQL begin with "@@". An identifier can hold up to 128 characters.




Related Article

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.