Hi,
I am running a VM with Windows Server 2019 + MS SQL SERVER 2019 - 64bit, 8Core 32GbRAM, 500Gb Disk Space
I am facing some issues with SQL Server 2019, using ODBC Driver (provider MSDASQL) running out of memory.
I am running OPENQUERY like SELECT * FROM OPENQUERY('remote__server', 'select column1, column2, column3 from schema.target_table where created__at>''2023-03-14 00:00:00'' and ''2023-03-15 23:59:59''');
This query worked a few times and then I started to get the "provider ran out of memory" error message
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "MSDASQL" for linked server "remote__server_" reported an error. The provider ran out of memory.
My intention is to collect some data from the remote_server and store it in a table in SQL Server. I was able to get about 100k records from the remote table and the provider ran out of memory started.
I am able to run the query using the interactive SQL from the ODBC driver outside the SQL Server which makes me believe there is some buffer or cache full in the SQL Server provider because I noticed each time doing the queries tried to set 6 months period then, 3 months...1month and now barely a 24hours period work.
I have tried to clean the SQL server cache and buffer but did not work.
Also, the max memory is set to 20GbRAM and is using only 4Gb so the physical memory should not be a problem here.
Does someone has some suggestion or went through the same issue before?
PS: I have tried to restart the SQL Server and the VM multiple times.