Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what would cause a linked server to return a limited amount of data?

We are having an issue with a server that we linked to our sql server 2012 instance.

The server that we linked through an odbc or oledb connection is Pervasive SQL.

Selecting from the linked server this way works as long as the result set is small:

select * from linked_server.database..mytable

If the result set is more than around 2mb (might be slightly more or less) then we get this error:

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "KSLAP208" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "KSLAP208".

However, the silly thing is that SSMS 2012 for instance displays all the columns that need to be returned and then immediatley errors out.

What would cause SSMS 2012 to produce an error on a result set that is too big? (more than 1-2mb)??

here's what i see in the odbc administrator:

enter image description here

like image 544
Alex Gordon Avatar asked Nov 04 '22 04:11

Alex Gordon


1 Answers

Option 1, disable pre-fetch

Sometimes, disabling pre-fetch will solve problems like this.

You can disable the prefetch by clearing the "Enable pre-fetch of data for queries" check box in the Performance tab when creating a DSN or adding "PREFETCH=0" to the connection string when creating a DSN-less connection.

More on this:

In the ODBC Data Source Administrator panel on the server, configure your linked server from System DSN. Under the Performance tab, uncheck the box 'Enable pre-fetch of data for queries'. OK, OK. Delete and re-create your linked server in SQL Management Studio.

Source

Option 2, Allow inprocess

  • Go to Linked Servers
  • Providers
  • MSOLAP (or similar)
  • Properties
  • Make sure "Allow inprocess" is enabled. Even if it is, turn it off. Save. And then turn it back on. Sometimes resetting this can help.
like image 65
Brian Webster Avatar answered Nov 12 '22 19:11

Brian Webster