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


Error while querying Linked server


Error while querying Linked server

Author
Message
venkat9.sql
venkat9.sql
SSC Veteran
SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)

Group: General Forum Members
Points: 270 Visits: 260
Hi all, I am a newbie to SQL Server. I have SQL Server 2008 R2 installed on a server machine and a linked server setup to an AS400 database using a IBMDASQL OLEDB Provider.
I was able to run queries against the AS400 database via the linked server using the four part query approach "Linkedserver"."Database"."Schema"."Table" till recently. For example

Select *
from "AS400"."AS400DB"."SPRDQY"."CRYRECDL6"

All of a sudden when my queries started to fail throwing of an error about the provider.

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "IBMDASQL" for linked server "AS400" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "IBMDASQL" for linked server "AS400".

The strange part is that when I run the same select statement in ssms on my client machine connected to the same server instead of directly in the ssms on the server machine, the query works fine and gets me the data from the AS400.

SSMS on both machines is sql server 2008 r2.

I am wondering what settings in my SSMS on the server machine that are different than the one on my client thats causing the error.

Any help would be appreciated..

___________________________________________________________________
If I can answer a question then anyone can answer it..trying to reverse the logic.. Hehe
Vedran Kesegic
Vedran Kesegic
Old Hand
Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)

Group: General Forum Members
Points: 382 Visits: 1255
Quoted_identifier

_____________________________________________________
Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers
blog.sqlxdetails.com - Transaction log myths

venkat9.sql
venkat9.sql
SSC Veteran
SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)

Group: General Forum Members
Points: 270 Visits: 260
Thanks for the reply..
Quoted identifier is already on. turning it off is throwing incorrect syntax error. I believe it has something to do with the Oledb provider seetings but what I dont understand is how can the provider work fine for the linked server when queried through the client machine instead of directly on server.. Sad

___________________________________________________________________
If I can answer a question then anyone can answer it..trying to reverse the logic.. Hehe
Vedran Kesegic
Vedran Kesegic
Old Hand
Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)

Group: General Forum Members
Points: 382 Visits: 1255
Do you connect with the same user (Login) to sql server in both cases? Is SSMS started with "run as admin" ?

_____________________________________________________
Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers
blog.sqlxdetails.com - Transaction log myths

venkat9.sql
venkat9.sql
SSC Veteran
SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)SSC Veteran (270 reputation)

Group: General Forum Members
Points: 270 Visits: 260
Thanks for the reply. I did find the soultion. The allow_inprocess option in the properties dialogue box for the OLEDB provider should be checked. I didn't completely understand for what this option is meant for but by trial and error, I found that if I uncheck this option, queries against the linked server on the server machine are not fetching the data throwing the above mentioned error. If I check this option (sometimes need to restart the sql server) queries against the linked server on the server machine work fine. Another thing I found while playing with this option is that this setting doesn't effect the sql server on 32 bit machines but only for 64 bit machines.
To answer your question above I do connect with the same login and the ssms is ran as admin. I am absolutely positive that allow_inprocess is the culprit (unless there is a bug) and now everything works fine for me.

___________________________________________________________________
If I can answer a question then anyone can answer it..trying to reverse the logic.. Hehe
Vedran Kesegic
Vedran Kesegic
Old Hand
Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)

Group: General Forum Members
Points: 382 Visits: 1255
Bravo! I used "allow inprocess" to make some db links to work (e.g. when connecting to oracle), but completely forgot that maybe that can help your case.

_____________________________________________________
Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers
blog.sqlxdetails.com - Transaction log myths

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