Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2008 returns "Memory limit of 10240 KB exceeded for buffered query"

I'm trying to fill a HTML table with some SQL Server 2008 r2 data, the controller (php_sqlsrv) works fine, the tables are filled very well, but when I try to retrieve a 2000 or more rows (maybe less) it crashes and shows this message:

SQL Error: Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -59 [code] => -59 [2] => Memory limit of 10240 KB exceeded for buffered query [message] => Memory limit of 10240 KB exceeded for buffered query ))

How can I fix this? Is this a PHP or a sqlsrv problem? Can I fix this from the SQL Server Management Studio?

like image 934
user3435588 Avatar asked Dec 09 '14 23:12

user3435588


2 Answers

Change the setting in php.ini.

Section: sqlsrv

Directive: sqlsrv.ClientBufferMaxKBSize.

like image 160
obotezat Avatar answered Sep 20 '22 18:09

obotezat


add two lines in php.ini

extension=php_pdo_sqlsrv_55_ts.dll
extension=php_sqlsrv_55_ts.dll
client_buffer_max_kb_size = '50240'
sqlsrv.ClientBufferMaxKBSize = 50240
like image 27
Sangat Avatar answered Sep 22 '22 18:09

Sangat