I am using php against SQL Server 2008 using the mssql driver. Anyone know of a way to pass a table value parameter into stored procedure?
1 Answer
Table-valued parameters are not yet supported by the PHP MSSQL Driver.
You'll have to try something else, like converting your TVP into XML and passing it as a stream.
1 Comment
AdamA
A few follow up notes: First, a note that the above referenced driver is the microsoft php driver, but not the driver ("mssql") many of us user which come standard with the php installation and used for cross platform reasons. Although tvps are currently not supported by the driver as something you can pass from a php data type. We did find a work around. If the tvp "TYPE" is already created in the database, then you can declare in a query a variable of this type and insert rows into it. You can then subsequently use this variable as a parameter to an execute command of the stored proc.
EXEC mySP @tname=N'mytable'and then mySP executes a query on the tablemytable?