缓冲查询的内存限制超过10240 KB

时间:2016-07-01 03:11:08

标签: php sql-server-2008 xampp sqlsrv

美好的一天,我尝试run queriessearching

但我得到了这个结果

  

错误号:IMSSP / -59

超出内存限制10240 KB   缓冲查询

这是我的查询

SELECT * From transaksi a 
left join Outlet b on a.Outlet = b.OutletCode
left join area c on b.areacode = c.areacode where b.BrandCode like  '%AR-1%'
and b.areacode like '%%' and b.OutletCode like '%%' and tanggal 
between '2016-03-01' and '2016-07-31'

从我上面的查询中得到16046 rows

- 测试 -

当我尝试进行仅显示10 rows的其他搜索时,该错误未显示。

SELECT * From transaksi a 
left join Outlet b on a.Outlet = b.OutletCode
left join area c on b.areacode = c.areacode where b.BrandCode like  '%AR-1%'
and b.areacode like '%%' and b.OutletCode like '%K-SRLM%' and tanggal 
between '2016-05-01' and '2016-05-10'

这里没有使用range显示411 rows

SELECT * From transaksi a 
left join Outlet b on a.Outlet = b.OutletCode
left join area c on b.areacode = c.areacode where b.BrandCode like  '%AR-1%'
and b.areacode like '%%' and b.OutletCode like '%K-SRLM%'

这是我的全文。

function show_it()
    {
        extract(populateform());
        if($date_search == "")
        {
            unset($date_search);
        }
        if(isset($date_search)){
        $explode = explode('-',$date_search);
        $start_date = inggris_date($explode[0]);
        $end_date = inggris_date($explode[1]);
        $result = $this->modelmodel->showdata("SELECT * From transaksi a 
                                                left join Outlet b on a.Outlet = b.OutletCode
                                                left join area c on b.areacode = c.areacode where b.BrandCode like  '%$tipenya%'
                                                and b.areacode like '%$area%' and b.OutletCode like '%$outlet%' and tanggal 
                                                between '$start_date' and '$end_date'
                                                ");
        }else{
        $result = $this->modelmodel->showdata("SELECT * From transaksi a 
                                                left join Outlet b on a.Outlet = b.OutletCode
                                                left join area c on b.areacode = c.areacode where b.BrandCode like '%$tipenya%'
                                                and b.areacode like '%$area%' and b.OutletCode like '%$outlet%' 
                                                ");
        }   
    }

1 个答案:

答案 0 :(得分:0)

  1. 关于'内存限制'问题: 要么在设置中增加内存限制,要么在查询中添加限制。
  2. 让我们知道哪个查询只为您提供10行。您的第一个查询仅搜索BrandCode喜欢'%AR-1%'提供日期之间。可能是其他查询只满足10个结果。