title: SQL Server last insert id return array in CodeIgniter
body: <p>i'm using sqlsrv driver in CI
  However, when i use the $this->db->insert_id() it returns me an array</p>
  
  <p>I'm doing this in the controller after a db insert</p>
  
  <p>Error Number: 42S22</p>
  
  <p>[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'Array'.</p>
  
  <p>Anybody can help?
  Thanks alot</p>
  
  <pre><code>Model
  function insert_message($data)
  {
   $this-&gt;db-&gt;insert('message', $data);
   $last_id = $this-&gt;db-&gt;insert_id();
   return $last_id;
  }   
  
  Controller
  $message = $this-&gt;Message-&gt;insert_message(
  $data = array(
          'admin_account_id'        =&gt; $accountid,
          'message_subject'     =&gt; $subject,
          'message_content'     =&gt; $content,
          'message_priority'    =&gt; $priority,
          'date_send'           =&gt; $date_send,
          'message_status'      =&gt; $status,
          'message_createddate' =&gt; date("Y-m-d H:i:s"),
          'message_send_usergroup'=&gt; $usergroup
      );
  
  );
  
  
  Database driver (sqlsrv_driver.php)
  function insert_id()
  {
  
      return $this-&gt;query('select @@IDENTITY as insert_id')-&gt;row('insert_id');
  }
  </code></pre>
  
  <p>the $data does not include the identity column.
  This is the code i'm using now but i'm still getting an Array from $last_id.</p>