Archive

Archive for May 20, 2013

An invalid schema or catalog was specified for the provider “SQLNCLI10” for linked server

May 20, 2013 Leave a comment

ERROR: while retrieving data over linked server … you receive below error

Msg 7313, Level 16, State 1, Line 2
An invalid schema or catalog was specified for the provider “SQLNCLI10” for linked server “LinkedServername.DBName .dbo.tablename”

Cause ::

the database named DBName on target server .. that is the server to which your linked server is pointing contains a SPACE in its name

so in reality the database name is   ” DBNAME   ”  that is it has leading or trailing spaces in its name …

steps to resolve the same

1>USE DBNAME;

GO
2> ALTER database DBNAME set single_user with rollback immediate

go

3> EXEC sp_renamedb ‘DBNAME  ‘, ‘DBNAME123

go

4> EXEC sp_renamedb ‘DBNAME123’, ‘DBNAME

above script will resolve the linked server error :

if you try to run below script and by pass step no. 3 .. you will receive an error saying database named DBNAME already exist

EXEC sp_renamedb ‘DBNAME  ‘, ‘DBNAME‘   (SQL need the new name to be different from the old name )

so follow step 1 to 4 .. to resolve error similar to below :: enjoy 🙂

An invalid schema or catalog was specified for the provider “SQLNCLI10” for linked server

 

Advertisements
Categories: linked Server