Sql-server – How to make a unique column with default value of UUID

sql serversql-server-2005

I have a key column for internal use which is just a increasing integer, but I would like to have a second unique column which is a UUID, but I don't know how to have a function called for the default value (so that SQL Server is creating the UUID and not java), is there any documentation that one could suggest to me for this?

Best Answer

CREATE TABLE TblUID
(
    ID INT NOT NULL,
    UID UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID()
)