07-31-2023, 04:49 AM
Server 2008:
When in SSMS connected to server1.DB1 and try:
SELECT * FROM
[server2].[DB2].[dbo].[table1]
as others noted, if it doesn't work it's because the server isn't linked.
I get the error:
> Could not find server DB2 in sys.servers. Verify that the correct
> server name was specified. If necessary, execute stored procedure
> sp_addlinkedserver to add the server to sys.servers.
To add the server:
reference: To add server using sp_addlinkedserver
Link: [1]:
To see what is in your sys.servers just query it:
SELECT * FROM [sys].[servers]
When in SSMS connected to server1.DB1 and try:
SELECT * FROM
[server2].[DB2].[dbo].[table1]
as others noted, if it doesn't work it's because the server isn't linked.
I get the error:
> Could not find server DB2 in sys.servers. Verify that the correct
> server name was specified. If necessary, execute stored procedure
> sp_addlinkedserver to add the server to sys.servers.
To add the server:
reference: To add server using sp_addlinkedserver
Link: [1]:
[To see links please register here]
To see what is in your sys.servers just query it:
SELECT * FROM [sys].[servers]