Linked server error

  • I had setup linked server and when i query the it gives me below error.

    QUERY:

    SELECT top * from [Servername].[WH_SYSTEM].[dbo].T_ENCOUNTER_PHYSICIAN

    WHERE PhysicianID LIKE '[0-9]%'

    Output:

    Msg 7357,Level 16, State 2, Line 1

    Cannot process the object ""WH_SYSTEM."dbo"."T_ENCOUNTER_PHYSICIAN"".

    The ole db provider "sqlncli10" for linked server '' servername" indicates that either the object has no columns or the current user does not have permissions on that object.

  • p.swathi4 (2/3/2014)


    The ole db provider "sqlncli10" for linked server '' servername" indicates that either the object has no columns or the current user does not have permissions on that object.

    The clue is in the error message. It's unlikely that the table has zero columns so it's a permissions issue. What security are you using for the linked server. Does that user have read permission on the table?

  • In your linked server definition, you specify the login that should be used in the connection to the remote server. On the linked server itself, that login has to have permissions to the database and table you're trying to query.

    I also noticed that in your SELECT statement, you need to specify the number of rows you want to return when using TOP. You should also use an ORDER BY clause to ensure you get back the TOP n rows based on something.

  • p.swathi4 (2/3/2014)


    I had setup linked server and when i query the it gives me below error.

    QUERY:

    SELECT top * from [Servername].[WH_SYSTEM].[dbo].T_ENCOUNTER_PHYSICIAN

    WHERE PhysicianID LIKE '[0-9]%'

    Output:

    Msg 7357,Level 16, State 2, Line 1

    Cannot process the object ""WH_SYSTEM."dbo"."T_ENCOUNTER_PHYSICIAN"".

    The ole db provider "sqlncli10" for linked server '' servername" indicates that either the object has no columns or the current user does not have permissions on that object.

    Please refer to your duplicate thread.

    TOP * will throw an error. Try TOP(10) *


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply