title: calling upload SP of MsSQL in codeigniter
body: <p>I need you help on how to call the stored procedure that I made in MsSQL, it is a upload function.</p>
  
  <p>here is my current code in CI:</p>
  
  <p><strong>Model</strong></p>
  
  <pre><code>function search($data){
  
      $qString="[gen048upload]";
  
  
      $this-&gt;db-&gt;query('set ansi_padding on
                          set ARITHABORT on
                          set CONCAT_NULL_YIELDS_NULL on
                          set QUOTED_IDENTIFIER on
                          set ANSI_NULLS on
                          set ANSI_WARNINGS on
                          set numeric_roundabort off');
      $query = $this-&gt;db-&gt;query($qString);    
      return ($query-&gt;num_rows() &gt; 0) ? $query-&gt;result() : NULL;
  }
  </code></pre>
  
  <p>my current controller is just for copying to other directory but here it is:</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>    function upgen048()
  {
  
      $this-&gt;file_path = realpath(navi_ups.'/gen048');
  
      $config['upload_path'] = $this-&gt;file_path;
      $config['max_size'] = 0;
      $config['allowed_types'] = 'txt';
      $config['overwrite'] = TRUE;
  
      $this-&gt;load-&gt;library('upload');
      $this-&gt;upload-&gt;initialize($config);
      $this-&gt;upload-&gt;set_allowed_types('*');
  
      if ( !$this-&gt;upload-&gt;do_upload('uploadData'))
          {   
                  $data['error'] = $this-&gt;upload-&gt;display_errors();
                  $data['main_content'] = 'upgen048';
                  $this-&gt;load-&gt;view('includes/template',$data);
          }
      else { //else, set the success message
                  $data = array('msg' =&gt; "Upload success!");
                  $data['main_content'] = 'upgen048';
                  $this-&gt;load-&gt;view('includes/template',$data);
                  $data['upload_data'] = $this-&gt;upload-&gt;data();
  
      }
  </code></pre>