Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Linked server query error


Linked server query error

Author
Message
psred
psred
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 485
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
SSC-Addicted
SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)

Group: General Forum Members
Points: 420 Visits: 1951
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
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

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

Thanks.
ChrisM@home
ChrisM@home
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1161 Visits: 9736
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
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 485
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