How to generate UniqueIdentifiers and insert in a column

  • Hi All,

    I have a table in which one of the column is UniqueIdentifier. I have NULLS from records 1 through 91 and then after I have records populated in the table. I need to fill up the NULLS with UniqueIdentifier. Can you please help me.

    My only concern is if I update the table now, after few months when new UniqueIdentifier gets generated as part of our ETL, which is once a day, should not cause duplicates.

    Please help.

  • Mac1986 (2/5/2013)


    Hi All,

    I have a table in which one of the column is UniqueIdentifier. I have NULLS from records 1 through 91 and then after I have records populated in the table. I need to fill up the NULLS with UniqueIdentifier. Can you please help me.

    My only concern is if I update the table now, after few months when new UniqueIdentifier gets generated as part of our ETL, which is once a day, should not cause duplicates.

    Please help.

    update dbo.MyTable set

    UniqueIdentifierCol = newid()

    where

    UniqueIdentifierCol is null;

    Chances of a dup are quite low, but not impossible.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply