• If you wanted to get a column to act like an identity column but to be a uniqueidentifier instead of an int you could do this:

    CREATE TABLE dbo.yourtable

    (

    pk_col AS newid(),

    xxx varchar(10) not null

    );

    GO

    INSERT dbo.yourtable (xxx) VALUES ('www'),('rrr');

    SELECT *

    FROM dbo.yourtable;

    The problem here is that you can't use the column as a Primary key or a Unique key or as part of a clustered index. 🙁

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001