Question

Why tables in AdventureWorksLT have both a PK column and a rowguid column? Is there any reason for that? What's the point of having both columns?

For the Product table, you've got ProductID and rowguid, with data type respectively int and uniqueidentifier.

Thanks for helping

Was it helpful?

Solution

The RowGUID is a globally unique identifier, theoretically no to GUIDs can ever be the same on the same machine thus they are used to stamp data that may move around, during replication for example.

We have a number of websites that posts orders to a central system, each site could use the same INT OrderNumber 1-9999 so we stamp all orders with a GUID and use that as a digital paper trail.

Humans don't like GUIDS on their order confirmations they like simple numbers which hi lights 1 possible need for both without even getting into table relationships and keys.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top