title: Store the value of output inserted._ID to local variable to reuse it in another query
body: <p>I want to simply execute a SQL query that would return the current id of the row that was added to a table, example:</p>
  
  <pre><code>insert into V_Post output inserted._ID values('Please return the id of THIS row :)')
  </code></pre>
  
  <p>That shall returns a number like 155</p>
  
  <p>So the aim of my question is to store that number in some kind of local variable like XVALUE and then use this XVALUE in any other SQL query like:</p>
  
  <pre><code>insert into V_Posts values(1, XVALUE, null, GETDATE(), null, null, 1)
  </code></pre>
  
  <p>So i thougt of something like:</p>
  
  <pre><code>int XVALUE = insert into V_Post output inserted._ID values('Please return the id of THIS row :)')
  
  insert into V_Posts values(1, XVALUE, null, GETDATE(), null, null, 1)
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>insert into V_Posts values(1, insert into V_Post output inserted._ID values('Please return the id of THIS row :)'), null, GETDATE(), null, null, 1)
  </code></pre>
  
  <p>But both it didn't work :(</p>
  
  <p>I hope i explained my question well and i really thank you in advance for your help.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Please notice i have two tables: V_posts and V_post</p>