Counter of Festivals

Ashok Blog for SQL Learners and Beginners and Experts

Friday, 7 June 2019

Linked Servers displaying local database catalog and not remote database catalog

 SELECT * FROM OPENQUERY(linkedservername, 'SELECT @@servername AS servername')

select * from sys.servers

when we create linked server  datasource should not be blank if blank it will take local server as source

https://social.msdn.microsoft.com/Forums/en-US/be11aa8c-0af6-45b9-b2e2-08b93fca2373/linked-servers-displaying-local-database-catalog-and-not-remote-database-catalog?forum=sqldataaccess

we can verify linked server name as using below query

EXEC sp_addlinkedserver 
   @server=N'linkedservername',             -- Remote Computer Name
   @srvproduct=N'',                 -- Not Needed
   @provider=N'SQLNCLI',            -- SQL Server Driver
   @datasrc=N'servername\instancename';  -- Server Name And Instance

No comments:

Post a Comment