title: Help with T-SQL script: Insert record, then use identity of that insert on another statement?
body: <p>Just as a preface, I'm not very knowledgeable on T-SQL syntax.</p>
  
  <p>I'd like to create a simple SQL script that will make 3 insert statements.</p>
  
  <pre><code>Insert A
  Insert B
  Insert C
  </code></pre>
  
  <p>Insert A statement's identity or "ID" would be needed in insert B statement.
  And both the identities Inserts A &amp; B would be needed in Insert C statement.</p>
  
  <p>Pseudo code would look something like:</p>
  
  <pre><code>INSERT INTO tableA
  VALUES ('blah', 'blah')
  
  INSERT INTO tableB
  VALUES (IDENTITY_FROM_A_INSERT, 'foo')
  
  INSERT INTO tableC
  VALUES (IDENTITY_FROM_A_INSERT, IDENTITY_FROM_B_INSERT)
  </code></pre>
  
  <p>How would I go about writing this script?</p>