Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php SQL Server table value parameter

Tags:

php

sql-server

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?

like image 361
AdamA Avatar asked Jan 13 '10 21:01

AdamA


People also ask

How do you create a table valued parameter in SQL Server?

Creating Table-Valued Parameter Types. Table-valued parameters are based on strongly typed table structures that are defined by using Transact-SQL CREATE TYPE statements. You have to create a table type and define the structure in SQL Server before you can use table-valued parameters in your client applications.

How do you use table valued parameters?

Table-valued parameters are declared by using user-defined table types. You can use table-valued parameters to send multiple rows of data to a Transact-SQL statement or a routine, such as a stored procedure or function, without creating a temporary table or many parameters.

What is user defined table type in SQL Server?

User-defined tables represent tabular information. They are used as parameters when you pass tabular data into stored procedures or user-defined functions. User-defined tables cannot be used to represent columns in a database table.


1 Answers

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.

like image 127
MartW Avatar answered Sep 28 '22 06:09

MartW