Relationships using OPENDATASOURCE function

Asked

Viewed 42 times

0

I need to list a table from one server and a view from another. I researched the function OPENDATASOURCE and later implemented it in the query. When executing, the program returns this message to me and I don’t understand where the error is.

OLE DB Provider "SQLNCLI11" for Linked server "(null)" returned message "Login timeout expired". OLE DB Provider "SQLNCLI11" for Linked server "(null)" returned message "A network-Related or instance-specific error has occurred while establishing a Connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote Connections. For more information see SQL Server Books Online.". Msg 53, Level 16, State 1, Line 0 Named Pipes Provider: Could not open a Connection to SQL Server [53]. OLE DB Provider "SQLNCLI11" for Linked server "(null)" returned message "Invalid Connection string attribute".

SELECT ZMDDIGITAL.ID, ZMDDIGITAL.CODCOLIGADA, ZMDCOALITION.NOMEFANTASIA, ZMDDIGITAL.PLATE, F.NAME, ZMDDIGITAL.RECCREATEDBY, ZMDDIGITAL.RECCREATEDON FROM ZMDDIGITAL INNER JOIN OPENDATASOURCE ('SQLNCLI','Data Source=Hostname;User ID=User;Password=Password;'). [Corporerm].dbo.EMPLOYEES AS F ON ZMDDIGITAL.PLATE = F.PLATE AND ZMDDIGITAL.CODCOLIGADA = F.CODCOLIGADA INNER JOIN ZMDCOALESCED ON ZMDDIGITAL.CODCOLIGADA = ZMDCOLIGADA.CODCOLIGADA WHERE ZMDDIGITAL.CODCOLIGADA = 1

  • 1

    To improve your question, I would bring the query you executed to generate this error log.

  • I changed the publication for a better understanding.

  • I suggest you use server binding (Linked server) instead of OPENDATASOURCE. Details in the article Programming and optimization of distributed queries -> https://portosql.wordpress.com/2019/06/30/linked-server/

  • The error message indicates the probable causes of the error; analyze one by one.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.