How to generate unique ROWGUID

  • Hi,

    I am inserting some values in a table say 'TEST', This table contains a column named "ROWGUID'(by-default or so). I am able to insert values to other columns of the table.

    So actually I wanted to know about this table column. What is be inserted into this column or is there any way to create random "GUID" for this column. I am in delemma that what should be entered into this column(system) through my program.

    Any help will be appreciated.

    A big thanks in advance

    with regards,

    Loku

  • The NEWID function generates a GUID

  • what is the data type of the column?

    a timestamp column could be used

  • Good question:

    I would bet the column is an identity field, which is maintained (incremented at insert) by the database, but you can supply this value also if you set identity off for this table.

    See MSN knowledge database for syntax and more knowledge on understanding identity fields!


    Regards,

    Coach James

  • Thank you all,

    Actually I have one table in SQL SERVER database. This table is imported from Oracle database. In SQL SERVER database, i have one more column named "rowguid", I dont know why this column in appended to every table in the database by default. So I wanted to assign some unique GUIDs for this column.

    But now I am able to insert the unique GUIDs in this column, you know how? What I did was, just do not enter anything to this particular column (rowguid). The SQL SERVER itself handled the GUIDs and inserted some guids.

    This is what I am thinking, any further suggestions are welcome

    thanks,

    Loku

     

  • LOKNATH: Please read my previous post!


    Regards,

    Coach James

  • Thanks James,

    from your previous message I got an idea

    thanks once again.

    regards,

    Loku

Viewing 7 posts - 1 through 6 (of 6 total)

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