Simple trick to run Microsoft SQL [MSSQL] Stored procedures in PHP

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)

$row[””””””””Return Value””””””””];

if its a variable use $row[””””””””Variable Name””””””””];

Share this post

4 thoughts on “Simple trick to run Microsoft SQL [MSSQL] Stored procedures in PHP”

  1. hanxlk says:

    Useful post… I”ve never worked with MSSQL and PHP… should try it when i find some time 😉

  2. mortgage says:

    Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I””ll be subscribing to your feed and I hope you post again soon.

  3. Virtual Memory Low says:

    Heyy, Found your blog on Google and I will definatley be recommending and coming back to the site! =)

  4. farmvill says:

    Thanks for ones blog loaded with so numerous information. Stopping by your blog helped me to get what I was seeking for.

Comments are closed.