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

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

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
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: