7

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?

2
  • You mean something like EXEC mySP @tname=N'mytable' and then mySP executes a query on the table mytable? Commented Jan 13, 2010 at 22:24
  • 1
    No, I actually mean passing in the data which represents the a table as the table value parameter. Commented Jan 14, 2010 at 13:29

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.