5

I have a DBF file on a network share that I'm trying to select into a SQL Server table.

This query:

SELECT * FROM OPENQUERY(MyLinkedServer, 'SELECT * FROM DP')

... throws this error:

OLE DB provider "MSDASQL" for linked server "MyLinkedServer" returned message "[Microsoft][ODBC Visual FoxPro Driver]Not enough memory for file map.".
Msg 7399, Level 16, State 1, Line 11 The OLE DB provider "MSDASQL" for linked server "MyLinkedServer" reported an error. The provider ran out of memory.
Msg 7320, Level 16, State 2, Line 11 Cannot execute the query "SELECT * FROM DP" against OLE DB provider "MSDASQL" for linked server "MyLinkedServer".

I've read about using SYS(3050) to release FoxPro's memory. I can't figure out how to execute that against the linked server though.

John Sansom
  • 41,005
  • 9
  • 72
  • 84
Laran Evans
  • 1,283
  • 5
  • 15
  • 31

2 Answers2

4

Linked server queries use memory from an area outside of the SQL Server buffer pool called memToLeave, which is used for servicing connection threads and now the sql clr amongs other things. On 32-bit it's 384 MB in size which can be inadequate for some scenarios.

If you need to adjust your SQL Server Memory configuration and in particular the memToLeave area you will find an explanation on the following blog:

SQL Server Memory Configuration, Determining memToLeave Settings

Mansfield
  • 14,445
  • 18
  • 76
  • 112
John Sansom
  • 41,005
  • 9
  • 72
  • 84
  • This was a while ago. Would you say this advice is still relevant, John? From a lot of fora it seems to be a recurrent issue and still looks a lot like a memory leak. At the moment the default MemToLeave is fine for the first few months of use and then suddenly none of the Access linked servers have enough memory left. Surely there's a way of re-initialising just the out of pool memory and processes dependent on it. – Adamantish Nov 29 '13 at 13:47
  • What operating system are you using? Is it 64bit? What version of SQL Server are you using etc. – John Sansom Dec 03 '13 at 15:36
0

If you're running SQL Server 2005 or even 2008 SP1 or earlier there's a hotfix for a memory leak issue: http://support.microsoft.com/kb/974130

Adamantish
  • 1,888
  • 2
  • 20
  • 23