Communicate between two Database that are on different servers.

  • Hi Friends ,

    I am having two database on two different machine one server is 'server1' and another is 'server2'

    both are in network.Both server have a common database name 'FoamDB' and i want to insert record from server2.FoamDB.dbo.Table to server1.FoamDB.dbo while i am currently workin on server1.

    what will be the insert statement?

    i am using following query that is not working..

    insert into [server1].FoamDB.dbo.bill select * from [server2].FoamDB.dbo.bill

    Error:

    Msg 7202, Level 11, State 2, Line 1

    Could not find server 'server2' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

  • you will need to set the second server up as a linked server to the first server before that query will work

    http://msdn.microsoft.com/en-us/library/ms190479.aspx%5B/url%5D

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

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