title: Get last inserted UNIQUEIDENTIFIER in SQL Server 2000
body: <p>The <code>OUTPUT</code> clause is compatible with SQL Server 2005 but not SQL Server 2000.</p>
  
  <p>How do I convert this command to work in SQL Server 2000?</p>
  
  <pre><code>CREATE TABLE sample
  (
   ID uniqueidentifier NOT NULL DEFAULT newid(),
   Title varchar(30) NOT NULL
  )
  
  INSERT INTO sample (Title)
  OUTPUT INSERTED.ID
  VALUES ('Test1')
  </code></pre>
  
  <p>I need the command to retrieve the ID since the <code>INSERT</code> command needs to be called from a stored procedure.</p>
  
  <p>Thanks for any help!</p>