I had lot of problems and difficulties to run Microsoft SQL stored procedures in PHP but i found a simple trick to do it easily and i think it will be helpful for you all 🙂
Running stored procedures using Microsoft SQL in PHP with MSSQL interface.
1.Create the Stored procedure in Microsoft SQL management studio and check in the query analyzer if the stored procedure executes with out no errors .
2.Create the MSSQL database connections in a PHP class or a PHP file
3.In Microsoft SQL management studio go to :
Database –> YourDatabaseName –> Programmability –> Stored procedures –> Execute the Stored Procedure
Right click the procedure name -> Execute
Stored procedure execution window
Get this code to a PHP String and Exicute it using mssql_query() as a normal database query execution
If the stored procedure output is a reutrn value $row=mssql_fetech_array($result)
if its a variable use $row[””””””””Variable Name””””””””];