Tuesday, October 28, 2014

What is Identifier in SQL Server?

I’ve come across this question many times in life – 
What is “Identifier” in SQL Server?
 So, I thought to write about it today. Here it goes.
In SQL Server we create objects like database, login, tables, views, stored procedures, columns, indexes, etc. We give a name to every object, which is used to refer to it later on. This name is known as “IDENTIFIER” in SQL Server. But, one must be surprised to know that there are objects in SQL Server, which don’t require identifier i.e. a name. For example, Constraints.
Identifiers are created at two levels:
 (i) SQL Serve Instance Level
 (ii) Database Level. 
Identifiers can be logically categorized into two categories:
 (i)  Regular Identifier
(ii) Delimited Identifier.
Regular identifier is one which conforms to the object naming rules in SQL Server while Delimited identifier is one which does not conform to object naming rules for SQL Server. Delimited identifiers are enclosed with either ( ‘  ‘ ) single quote or ( [  ] ) square bracket.

No comments:

Post a Comment