In the documentation for calling a SQL Server stored procedure with parameters from PHP using the sqlsrv extension, it uses a bizarre syntax:
{call SubtractVacationHours( ?, ?)}
What I would expect would be:
EXEC SubtractVacationHours ?, ?;
In the SQL Server documentation for executing a T-SQL stored procedure it only allows EXEC | EXECUTE as the command words. So I would have thought the query would cause an error.
You can certainly call sqlsrv_query
with SQL of EXEC SubtractVacationHours with specified parameters (i.e. with the question marks replaced with values).
After some further research on Parameterised queries, it seems that the 'CALL' comes from having to call it through an ODBC provider.
So will the second EXEC syntax actually work? Or do parameterized stored procedure calls through the sqlsrv driver have to use the ODBC CALL syntax?