1
有没有办法将sqlsrv_num_rows()与存储过程一起使用?存储过程和sqlsrv_num_rows - 光标错误?
基本上当我尝试使用此功能,我收到这些错误之一,这取决于光标i电源:
Array ([0] => Array ([0] => IMSSP [SQLSTATE] => IMSSP [1] => -50 [code] => -50 [2] => This function only works with statements that have static or keyset scrollable cursors. [message] => This function only works with statements that have static or keyset scrollable cursors.))
或
Array ([0] => Array ([0] => 01000 [SQLSTATE] => 01000 [1] => 16954 [code] => 16954 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Executing SQL directly; no cursor. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Executing SQL directly; no cursor.) [1] => Array ([0] => 01S02 [SQLSTATE] => 01S02 [1] => 0 [code] => 0 [2] => [Microsoft][SQL Server Native Client 10.0]Cursor type changed [message] => [Microsoft][SQL Server Native Client 10.0]Cursor type changed))
我花了一些时间尝试寻找这个问题的解决方案,但没有运气。
如何从使用SqlSrv的存储过程获取行计数?我将不得不手动循环遍历结果和$ count ++;我想避免这种情况。或者,有什么办法可以改变实际的存储过程来包含光标?我对游标不是很熟悉,所以我不知道这是否是解决方案。
预先感谢您!
太棒了,我认为这可能只是工作。谢谢! – tcarter2005