Q

Common DBMS table and column name restrictions

SQL Server 2000 DBMS table and column name restrictions are detailed by expert Joe Toscano

What are the common name restrictions on tables and columns in a database management system (DBMS)?
DBMS table and column names under SQL Server 2000 have a 1 through 128-byte limit and follow the rules established for identifiers.

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 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 @@.

    Subsequent characters can be any of the following:

     

  • 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
  • The identifier must not be a Transact-SQL reserved word. SQL Server reserves both the uppercase and lowercase versions of reserved words. Embedded spaces or special characters are not allowed although you will see these objects in good old Northwind with names that include embedded spaces. You'll have to access them by enclosing them in brackets.

This was first published in May 2006

Dig deeper on Microsoft SQL Server Database Development

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close