SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Linked server query error


Linked server query error

Author
Message
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)

Group: General Forum Members
Points: 153 Visits: 583
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.
Sreekanth B
Sreekanth B
SSChasing Mays
SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)SSChasing Mays (607 reputation)

Group: General Forum Members
Points: 607 Visits: 2067
Have you checked the permissions? Are you sure, the remote user defined in the linked Server has appropriate permissions to access the tables on your remote server? How is the security defined in your Linked Server? Are you able to test the linked Server successfully and do you see your remote table(which you are trying to query) after expanding your catalog(s) under your linked server from Object Explorer?
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)

Group: General Forum Members
Points: 153 Visits: 583
yes i can see the tables under catalog. Just now i gave read permissions and it worked.

Thanks.
ChrisM@home
ChrisM@home
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2062 Visits: 10373
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.

Linked server error messages rarely tell you anything useful. There's an error in your query.
Try SELECT TOP(10) *


Low-hanging fruit picker and defender of the moggies





For better assistance in answering your questions, please read this.




Understanding and using APPLY, (I) and (II) Paul White

Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)SSC-Enthusiastic (153 reputation)

Group: General Forum Members
Points: 153 Visits: 583
sorry mistyped query in forum.

I checked the security and permissions and it works now.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search