title: New uniqueidentifier on the go
body: <p>I want to add a column for a table which would become a PRIMARY KEY and be of type uniqueidentifier. I have this, but I wonder if there is a faster (in fewer code lines) way?</p>
  
  <pre><code>ALTER TABLE [table] ADD [id] [uniqueidentifier] 
      DEFAULT('00000000-0000-0000-0000-000000000000') NOT NULL
  GO    
  UPDATE [table] SET [id] = NEWID()
  GO    
  ALTER TABLE [table] ADD CONSTRAINT [PK_table_id] PRIMARY KEY CLUSTERED 
  GO
  </code></pre>