Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011

    Question Unanswered: need a help to connect another db?


    i want to connect another server from my local server using sql command, i am using sql server 2005 and i tired googling it and got one query

    select * from [servername].[instance name].[ownername].[tablename]

    when i executed this on my local server i got this error message

    Cannot initialize the data source object of OLE DB provider "SQLNCLI" for linked server "ServerName".

    thanks in advance


  2. #2
    Join Date
    Nov 2004
    Provided Answers: 4
    You must replace [servername], [instance name], [ownername] and [tablename] with the respective values for your system.

    When I open MS SQL Server Management Studio on my PC, Object Explorer shows this (see attachment).
    For the table ErrorLog:
    [servername] is WHUBxxxxxxZ
    [instance name] is AdventureWorks
    [ownername] is dbo
    and [tablename] is ErrorLog

    Given that information, one can construct a valid select statement:
    SELECT * 
    from WHUBxxxxxxZ.AdventureWorks.dbo.ErrorLog
    Attached Thumbnails Attached Thumbnails MSSQLObjectExplorer.jpg  
    With kind regards . . . . . SQL Server 2000/2005/2012

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts