title: MS SQL Server Last Inserted ID
body: <p>In my database all tables are using a common table for Sequence(ID_Table).</p>
  
  <p>TABLE_ID has two fields (Common_ID, Table_Name).</p>
  
  <p>If I insert any record in the table, I have to first insert a record in Table_ID(Auto-increment, Table_name) then use that Auto-increment value in my Other Table.</p>
  
  <p>For example, I want to insert in Table_Products which has fields ID(Common_ID), Product_Name, Product_ID(Auto Increment)</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>INSERT INTO TABLE_ID (Table_NAME), Values (Table_Products)
  </code></pre>
  
  <p>Get the Inserted ID and use it in Table_Products:</p>
  
  <pre><code>INSERT INTO Table_Products (ID, Product_Name, Product_ID(Auto Increment) 
  VALUES (ID from TABLE_ID, SomeProduct, Increment)
  </code></pre>