CodeIgniter Forums
Execute MSSQL Stored Procedure - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Execute MSSQL Stored Procedure (/showthread.php?tid=68780)



Execute MSSQL Stored Procedure - wahdicandras - 08-24-2017

Hello I have a problem to exec stored procedure of MSSQL use CodeIgniter. 

While i use $this->db->query("EXEC SP_NAME")->result();
also return an empty array.

 But in this case if I exec in Management Studio with this command also return data.

 Please help me if you know because its important.
 Thank You.


RE: Execute MSSQL Stored Procedure - craja26 - 12-16-2017

(08-24-2017, 06:52 PM)wahdicandras Wrote: Hello I have a problem to exec stored procedure of MSSQL use CodeIgniter. 

While i use $this->db->query("EXEC SP_NAME")->result();
also return an empty array.

 But in this case if I exec in Management Studio with this command also return data.

 Please help me if you know because its important.
 Thank You.

Hi wahdicandras,
looks like you forgot to add brackets "()". Please see the below code. hope it will work.
[/url]$query = $this->db->query("call SP_NAME()");
return $query->result_array();
[url=https://forum.codeigniter.com/user-13923.html]


Thank you,
Raja