May 12, 2011 at 10:54 am
I added a linked server (both servers are in my domain) and the connection tests successfully. I can see the table that I am trying to access data from. However, when I try and execute my query, I get the message "Could not locate entry in sysdatabases for SERVERNAME. No entry found with that Name. Make sure that the name is entered correctly.
Here is a portion of my query:
use LINKEDSERVERNAME.Catalog.database.table
go
SELECT tim.Number, tim.DisplayName, TkprStatus
I've tried with the linked server name in brackets, with/without catalog, etc. etc.
Can anyone assist?
thanks,
Janet
May 12, 2011 at 10:58 am
You're syntax is incorrect.
Try the following:
SELECT tim.Number, tim.DisplayName, tim.TkprStatus from LINKEDSERVERNAME.database.schema.table as tim
May 12, 2011 at 11:00 am
Janet first do SELECT * FROM sys.servers
are you sure the servername is [LINKEDSERVERNAME]?
next, after you see the server name, do this:
EXEC sp_tables_ex MyLinkedServer
that should give you the lsit of tables in the default database of your connection;
finally, i think your exampe (catalog.database.table?) isn't right;
it should be LinkedServername.Database.Schema.tableName, like this:
SELECT * FROM MyLinkedServer.SandBox.dbo.Invoices
--or
SELECT * FROM MyLinkedServer.Production.sys.tables
Lowell
May 12, 2011 at 1:24 pm
Thank you both.
After I ran EXEC sp_tables_ex MyLinkedServer and changed my syntax - it worked.
😀
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply