I'm struggling with accessing the result set of a stored procedure using the SQL Server Driver for PHP 1.1. I've already got a few of them running, but this one is special in that it has an XML input parameter which is parsed into a table variable. This
table variable is then used within a select statement. When I execute the SP within Management Studio, it runs fine and returns exactly one result set with multiple rows. But when I execute it from PHP, I get the error message "Executing SQL directly;
no cursor. ". I've tried every cursor type out there, the only one that doesn't fail is SQLSRV_CURSOR_FORWARD, but with that I'm not getting any results at all.
The original SP is enormous, so I have stripped it down as far as I could so it still throws the error. If I remove the bold part, my PHP code executes fine.
USE [testsite] GO
SET QUOTED_IDENTIFIER ON
ALTER PROCEDURE [dbo].[getCrossSellingItems]
SET NOCOUNT ON ;
DECLARE @tblInputIds TABLE
INSERT INTO @tblInputIds (Id)
T.Item.value('@Id', 'INT') FROM @InputIds.nodes('/Root/Item') AS T(
View Complete Post