• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execute MSSQL Stored Procedure

#1
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.
Reply

#2
(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
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.