SQL SERVER – Explanation and Example Four Part Name

What is four part name?

Explanation : ServerName.DatabaseName.DatabaseOwner.TableName

Example : localhost.AdventureWorks.Person.Contact

Reference : Pinal Dave (http://blog.SQLAuthority.com)

About these ads

10 thoughts on “SQL SERVER – Explanation and Example Four Part Name

  1. Pingback: SQL SERVER - Executing Remote Stored Procedure - Calling Stored Procedure on Linked Server Journey to SQL Authority with Pinal Dave

  2. Pingback: SQL SERVER - 2005 - Introduction and Explanation to SYNONYM - Helpful T-SQL Feature for Developer Journey to SQL Authority with Pinal Dave

  3. Pingback: SQL SERVER - Identifiers As Valid Object Names Journey to SQL Authority with Pinal Dave

  4. In the example for a 4-part name, does the server name refer to the name of the computer or does it refer to the name of the SQL Server instance? These will not necessarily be the same names.

  5. Aren’t all indexes created as separate structures from a table? Although the index is created against a particular
    table, doesn’t the index itself exist in the database as a separate, self-contained structure?

    Which index type — clustered or nonclustered — logically
    sorts the database of a table?

  6. Pingback: SQL SERVER - Guidelines and Coding Standards Part - 1 Journey to SQL Authority with Pinal Dave

  7. brother i will need to enter the data to the table of db1 from db2 and db1 is on remote server
    please send me the syntax if possible

  8. Hello Kasif,

    1. Copy data using Import/Export wizard or SSIS package.
    2. Insert data using OPENQUERY function
    3. Insert data using OPENROWSOURCE function
    4. Insert using 4 part naming. you would need to create a LinkedServer for this.
    5. Create script of data at source server and run on target database. As this would need more workaround so not recommonded.

    Pinal Dave

  9. Hi,
    I am very much impressed with your sql blogs and posting.Pinal I have newly stepped into SSIS package could you please help me around in this ….

    How to run a stored procedure in ssis package .And i have to pass the parameter’s from excel sheet .Like this

    =”exec st_example ‘” &F2 &”‘, ” & E2 & “, ‘” & H2 & “‘”

    and in the excel sheet , i need to pass the parameter by row by row .it would contains about 800 row ‘s .i am running this stored prod manually daily.

    And i have to schedule this job and send an alert mail.

  10. Sir i am new about to linked server.i am using this in my local server

    @server=’ip address of my remote server’,

    and then i make this query:

    SELECT *

    FROM OPENQUERY(‘ipadress’,databasename.uid.’select * from tbl_Products ‘)

    it not work. plz sir help me.
    Randeep Chauhan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s