SQL SERVER – Identifiers As Valid Object Names

Previous I wrote blog post about SQL SERVER – Explanation and Example Four Part Name. It was explaining the new feature of SQL Server 2005 of Schema. Few days ago I received email from Chi-Ho, Min of Taiwan, he suggested that he was successfully able to use column without completely specifying all the parts but just using servername…tablename. Please note the three dots (.) between servername and table.

It was interesting what Chi-Ho observed so I decided to share with all of you. Please visit SQL SERVER – Explanation and Example Four Part Name for basic understanding of the four part name. Server, database or owner/schema names are known as qualifiers of the object name. Object does not need to have all three qualifiers when refered. Most of the time objects are refered without servername qualifier as that defaults to local server.

The qualifiders can be omitted by using simple dot too. There are few valid forms of object which are listed here. An object name that specifies all four parts is known as a fully qualified name.

  • server.database.schema_name.object_name
  • server.database..object_name
  • server..schema_name.object_name
  • server…object_name
  • database.schema_name.object_name
  • database..object_name
  • schema_name.object_name
  • object_name

Reference : Pinal Dave (https://blog.sqlauthority.com) , BOL – Using Identifiers As Object Names

SQL System Table
Previous Post
SQL SERVER – Generate Foreign Key Scripts For Database
Next Post
SQL SERVER – 2008 – Update Resolving Conflict Between SQL Server 2005 and SQL Server 2008

Related Posts

1 Comment. Leave new

  • I got a query which has around 5 Union all’s
    It is having duplicates, but I am not able to figure it out which query amongst all is leading to duplicates. One of my friend suggested to apply identifiers to each
    query but I have no idea how to do that …any suggestions

    Reply

Leave a Reply