Datasheet

The name can be up to 128 characters for normal objects and 116 for temporary objects.
Any names that are the same as SQL Server keywords or contain embedded spaces must be
enclosed in double quotes (
“”) or square brackets ([]). Which words are considered keywords
varies, depending on the compatibility level to which you have set your database.
Note that double quotes are acceptable as a delimiter for column names only if you have SET QUOTED_
IDENTIFIER ON
. Using square brackets ([ and ]) eliminates the chance that your users will have the
wrong setting but is not as platform independent as double quotes are.
These rules are generally referred to as the rules for identifiers and are in force for any objects you name
in SQL Server. Additional rules may exist for specific object types.
Summary
Like most things in life, the little things do matter when thinking about an RDBMS. Sure, almost anyone
who knows enough to even think about picking up this book has an idea of the
concept of storing data in
columns and rows, even if they don’t know that these groupings of columns and rows should be called
tables, but a few tables seldom make a real database. The things that make today’s RDBMSs great are the
extra things the objects that enable you to place functionality and business rules that are associated
with the data right into the database with the data.
Database data has
type, just as most other programming environments do. Most things that you do in
SQL Server are going to have at least some consideration of type. Review the types that are available,
and think about how these types map to the data types in any programming environment with which
you are familiar.
Again, I can’t stress enough the importance of avoiding the use of SQL Server key-
words or embedded spaces in names. Although both are technically legal as long as
you qualify them, naming things this way will cause you no end of grief.
16
Chapter 1
04_584340 ch01.qxp 10/18/06 2:11 PM Page 16