title: Get Primary key names from a table variable TSQL
body: <p>How do I get the primary key names from a declared table variable.</p>
  <p>Example:</p>
  <pre><code>DECLARE @Table1 TABLE (id int PRIMARY KEY)
  DECLARE @Table2 TABLE (id1 int, id2 int, id3 int PRIMARY KEY(id1, id2, id3))
  </code></pre>
  <p>The first example, I should expect <code>id</code> as the return value.</p>
  <p>In the second example, I should expect <code>id1</code> <code>id2</code> <code>id3</code> as the return values.</p>
  <p>Thank you in advance.</p>