title: How can i get result returned by calling @@IDENTITY through sqlsrv extension?
body: <p>I have some SP (stored procedure) like:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[PROC_INSERT_ELEMENTS]
  @IN_OWNER_CLASS_ID  int
  AS
  INSERT INTO [dbo].[ELEMENTS] (OWNER_CLASS_ID)  VALUES (@IN_OWNER_CLASS_ID)
  RETURN @@IDENTITY
  </code></pre>
  
  <p>And some PHP function, to call this SP:</p>
  
  <pre><code>function createEmptyElement($class){
  $conn = l_connection::db_connect();
  $proc_query = '{ call PROC_INSERT_ELEMENTS ( @IN_OWNER_CLASS_ID=? ) }';
  $params = array(
  array(&amp;$class-&gt;ID, SQLSRV_PARAM_IN),
         );
  $resource=sqlsrv_query($conn, $proc_query, $params);
  sqlsrv_next_result($resource);
  sqlsrv_fetch($resource);
  var_dump(sqlsrv_get_field($resource, 0));
  </code></pre>
  
  <p>I want to get <code>ID</code> of new created row at <code>ELEMENTS</code> table, but i can't do this, because <code>@@IDENTITY</code> doesn't return row (i think).</p>
  
  <p>Oh, and i can't change SP.</p>