How To Connect From SQL Server Database To Another SQL Server Database
September 6th, 2007 | by programming |In order to do this, you will have to link the second server to your current server. You can do this by using linked servers option in enterprise manager or by using the stored procedure called sp_addlinkedserver.
Then in your query you can use tables of the remote server by qualifying the table name with the linked server name.
For Example:
select * from linkedServerName.tablename
where linkedServerName=remote_server_name of the linked server defined while linking the server tablename=remote_table_name of table on the remote server.