none
Execute query for report on multiple servers

Answers

  • Use [] to enclose server name and the instance

    like

    [ServerName\InstanceName].DatabaseName.dbo.TableName.

    Hope this helps..


    Vijey

    • Marked as answer by Skazimax Thursday, April 12, 2012 9:05 AM
    Thursday, April 12, 2012 8:59 AM
  • Yes, it is possible. You need have the SQL Servers are linked servers.

    More detail on linking servers.

    http://msdn.microsoft.com/en-us/library/aa213778(v=sql.80).aspx

    Once you have the linked servers, you could access the database on other server by using fully qualifying name (example: SQLServerName.DatabaseName.dbo.TableName)

    Hope this helps


    Regards,
    Adhi
    My TFS Blog
    Please remember to mark as answered, if this reply helps

    • Proposed as answer by kcmania Wednesday, April 11, 2012 5:07 PM
    • Marked as answer by Lola WangModerator Thursday, April 12, 2012 3:30 AM
    Wednesday, April 11, 2012 3:54 PM

All replies

  • Yes, it is possible. You need have the SQL Servers are linked servers.

    More detail on linking servers.

    http://msdn.microsoft.com/en-us/library/aa213778(v=sql.80).aspx

    Once you have the linked servers, you could access the database on other server by using fully qualifying name (example: SQLServerName.DatabaseName.dbo.TableName)

    Hope this helps


    Regards,
    Adhi
    My TFS Blog
    Please remember to mark as answered, if this reply helps

    • Proposed as answer by kcmania Wednesday, April 11, 2012 5:07 PM
    • Marked as answer by Lola WangModerator Thursday, April 12, 2012 3:30 AM
    Wednesday, April 11, 2012 3:54 PM
  • Thanks!

    One more question, i created linked server, i see it in a linked server as server\instance, but if i try to run query like this:

    select * from server\instance.master.sys.databases it didn't recognize server name, seems that '\' is a problem, how to properly point to server instance in query:

    Thursday, April 12, 2012 8:45 AM
  • Use [] to enclose server name and the instance

    like

    [ServerName\InstanceName].DatabaseName.dbo.TableName.

    Hope this helps..


    Vijey

    • Marked as answer by Skazimax Thursday, April 12, 2012 9:05 AM
    Thursday, April 12, 2012 8:59 AM