Welcome Guest, Not a member yet? Register   Sign In
MSSQL Stored Procedure & Active Record
#1

[eluser]davidk43[/eluser]
I'm wondering what is the best way to execute a stored procedure from Codeigniter. I have an application that is running on MSSQL2008 (for its XQuery support) and would like to know what is the best way to comply and use codeigniters active record database class without completely rolling my own solution.

Outside of CI I'd normally write something native like this:

Code:
$stmt=mssql_init("myprocedure", $conn);

/* now bind the parameters to it */
mssql_bind($stmt, "@id",    $id,    SQLINT4,    FALSE);
mssql_bind($stmt, "@name",  $name,  SQLVARCHAR, FALSE);
mssql_bind($stmt, "@email", $email, SQLVARCHAR, FALSE);    
        
/* now execute the procedure */
$result = mssql_execute($stmt);

Is it best I keep it separate and roll my own or is there a nifty accepted way to do this within CI's mssql driver?

thanks for any thoughts.
David


Messages In This Thread
MSSQL Stored Procedure & Active Record - by El Forum - 06-30-2010, 08:20 AM
MSSQL Stored Procedure & Active Record - by El Forum - 09-08-2010, 06:28 PM
MSSQL Stored Procedure & Active Record - by El Forum - 09-14-2010, 02:26 AM
MSSQL Stored Procedure & Active Record - by El Forum - 09-14-2010, 06:50 AM
MSSQL Stored Procedure & Active Record - by El Forum - 09-14-2010, 06:59 AM
MSSQL Stored Procedure & Active Record - by El Forum - 09-14-2010, 08:00 AM
MSSQL Stored Procedure & Active Record - by El Forum - 12-10-2010, 03:47 PM
MSSQL Stored Procedure & Active Record - by El Forum - 12-11-2010, 08:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB