Trouble with Linked Server

  • 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

  • You're syntax is incorrect.

    Try the following:

    SELECT tim.Number, tim.DisplayName, tim.TkprStatus from LINKEDSERVERNAME.database.schema.table as tim

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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