GUID datatype in SQL Server 2000

  • Hi All,

    Its very urgent to me can anyone suggest.

     

    I have to use GUID as datatype for one field in table. I created the table with the field name and data type as UniqueIdentifier and default value as newid().

    Everything fine for me and when ever the run the SQL it inserting the newid() values in the table.

    However I just have small doubt, every time I have to use default value or any other way where I can insert the values to GUID field in the table through insert query.

    I tried inserting the GUID value through the insert query, however its giving error.

    Please suggest me on the same and let me know whether there are any articles on the same.

    Thanks,

    Kishore

  • Nandy (11/4/2008)


    However I just have small doubt, every time I have to use default value or any other way where I can insert the values to GUID field in the table through insert query.

    You can insert a value or leave the default to put the value in. Either will work. Default just allows you to not specify a value and have a value put in by default. It's not like identity where you can't easily specify the value.

    I tried inserting the GUID value through the insert query, however its giving error.

    What error? What was the insert statement?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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