不明白,你为什么要显示的写WITH(PAGLOCK,HOLDLOCK)没这个必要吧。

解决方案 »

  1.   

    上面错了。第一段应该是:From tblSaleItem WITH(HOLDLOCK)-------------------要修改的地方应该是下面:Begin tranSELECT ProductCode,SUM(QuantitySold) as 'Quantity of produce',
           (select sum(QuantitySold) FROM tblSaleitem) as 'Total Units',
           Convert (Decimal (8,3),Sum (QuantitySold) * 100.0) / (SELECT SUM(QuantitySold) From tblSaleItem) as 'Percent'
    From tblSaleItem WITH(HOLDLOCK)-------------------要修改的地方
    Group by ProductCode
    Order by productCode
    这两段代码是我想看看,行级锁,和叶级锁的进程数。。谢谢大力。
    能不能再帮我看看。