You don't actually convert, NEWID()
returns an uniqueidentifier
:
NEWID (Transact-SQL)
Creates a unique value of type uniqueidentifier.
A separate note, though: Be wary of using uniqueidentifier
s as primary keys if you do not have a separate clustered index. Since uniqueidentifiers are not sequential, your inserts will have worse performance than if using a sequentially incrementing key.