In SQL, ROWGUIDCOL indicates that the new column is the globally unique identifier column of the row. Only one uniqueidentifier column can be assigned to each table as the ROWGUIDCO column. The ROWGUIDCOL attribute can only be assigned to the uniqueidentifier column
Uniqueidentifier:
1. Use the NewID () function to implement
2. Directly convert the constant of the string to xxxxxxxx-xxxx-xxxxxxxxxxxx
Example: 6F9619FF-8B86-D011-B42D-00C04FC964FF
3. Directly assign 32-bit sixteen-bit data
For example, 0xffffffffffffffffffffff00000000
Others
In SQL Server 2005, there is a data type uniqueidentifier, which is used to support GUID (Global Unique Identifier ). The value of this type is a 32-length string, for example, "00000002-3378-a87f-92pj-2t68i97o34ms ". GUID can ensure the global uniqueness of the ID and facilitate database integration, so as to avoid unnecessary conflicts due to the same ID during data Copy and conversion. In C #, there is a Guid class, which facilitates us to generate and operate GUIDs. For example, you can obtain a new Guid by using GUID. NewGuid. ToString. In fact, GUID can be considered as the MD5 Hash of the timestamp. In Lotus, each Document has a globally unique identifier called UNID (unique identifier ). This UNID has the same mechanism as the GUID. In my recent project, I have completed the transformation from a Lotus document database to an SQL Server relational database. It involves many operations on GUID and UNID. In SQL Server 2005, the uniquidentifier type value can always be converted to a varchar type with a fixed length (32) using casting.