How to make a Query betweenSQL Servers

  • I have Two SQL Servers in the same Network, Server A and Server B

    how i make a reference from the server A to Server B

    ex. if i want to make a reference between Databases in the same server , i do this.

    Select * from database..table

    but how i do betwenn Servers ?????

    thanks .

  • If they are set up as linked servers, you can just add the name of the server to the reference.

    Servername.DatabaseName.Schema.Table .

    If you don't want to use linked servers(not sure why you wouldn't), you can still use OPENQUERY.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • Thanks a lot, it is already done ;);););););)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply