ERROR:
An invalid schema or catalog was specified for the provider “SQLNCLI” for linked server “server name”
EXPLANATION:
Suppose you have a linked server named “Contoso”.
We get this error when we want to query a table named “Customers” from a database named “Management” on the Contoso server from another server as follows.
1 |
SELECT * FROM CONTOSO.Management..Customers |
SOLUTION:
Make sure that you use Fully Qualified Name in the queries you use in Linked Server. The draft of this is as follows:
[Linked Server Name].[Database Name].[Schema Name].[Object Name]Example:
1 |
SELECT * FROM CONTOSO.Management.dbo.Customers |