KnobCreek


Hi All,

Can someone plz let me know what are the column naming rules in sql2000





Re: Column Naming Rules

KnobCreek


can any1 help me





Re: Column Naming Rules

Arnie Rowland

In Books Online, refer to these Topics:

Using Identifiers (SQL 2000)

About Identifiers (SQL 2005)

For SQL 2000, the rules are (and SQL 2005 is virtually the same):

  1. The first character must be one of the following:
    • A letter as defined by the Unicode Standard 2.0. The Unicode definition of letters includes Latin characters from a through z and from A through Z, in addition to letter characters from other languages.

    • The underscore (_), "at" sign (@), or number sign (#).

      Certain symbols at the beginning of an identifier have special meaning in SQL Server. An identifier beginning with the "at" sign denotes a local variable or parameter. An identifier beginning with a number sign denotes a temporary table or procedure. An identifier beginning with double number signs (##) denotes a global temporary object.

      Some Transact-SQL functions have names that start with double at signs (@@). To avoid confusion with these functions, it is recommended that you do not use names that start with @@.

  2. Subsequent characters can be:
    • Letters as defined in the Unicode Standard 2.0.

    • Decimal numbers from either Basic Latin or other national scripts.

    • The "at" sign, dollar sign ($), number sign, or underscore.
  3. The identifier must not be a Transact-SQL reserved word. SQL Server reserves both the uppercase and lowercase versions of reserved words.

  4. Embedded spaces or special characters are not allowed.

When used in Transact-SQL statements, identifiers that fail to comply with these rules must be delimited by double quotation marks or brackets.