Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error while querying Linked server Expand / Collapse
Author
Message
Posted Wednesday, February 6, 2013 2:25 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:41 PM
Points: 212, Visits: 230
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..
Post #1416739
Posted Wednesday, February 6, 2013 5:31 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, September 29, 2014 5:52 AM
Points: 369, Visits: 1,215
Quoted_identifier

_____________________________________________________
Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers
blog.sqlxdetails.com - Transaction log myths
Post #1416769
Posted Thursday, February 7, 2013 10:26 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:41 PM
Points: 212, Visits: 230
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..










___________________________________________________________________
If I can answer a question then anyone can answer it..trying to reverse the logic..
Post #1417232
Posted Thursday, February 7, 2013 5:36 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, September 29, 2014 5:52 AM
Points: 369, Visits: 1,215
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
Post #1417405
Posted Monday, February 11, 2013 9:00 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:41 PM
Points: 212, Visits: 230
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..
Post #1418500
Posted Monday, February 11, 2013 4:25 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, September 29, 2014 5:52 AM
Points: 369, Visits: 1,215
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
Post #1418685
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse