GUID se foloseste ca identificator unic in special de dezvoltatori pentru ca este relativ comod de folosit.
Personal evit folosirea GUID deoarece cauzeaza probleme serioase de performanta (a se vedea:The Cost of GUIDs as Primary Keys ). In plus chiar Books Online enumera urmatoarele dezavantaje:
The uniqueidentifier data type has the following disadvantages:
- The values are long and obscure. This makes them difficult for users to type correctly, and more difficult for users to remember.
- The values are random and cannot accept any patterns that may make them more meaningful to users.
- There is no way to determine the sequence in which uniqueidentifier values were generated. They are not suited for existing applications that depend on incrementing key values serially.
- At 16 bytes, the uniqueidentifier data type is relatively larger than other data types, such as 4-byte integers. This means indexes that are built using uniqueidentifier keys might be relatively slower than indexes using an int key.
Exista si multi care au argumente pro GUID mai ales de cand SQL Server 2005 a introdus functia NEWSEQUENTIALID.
GUID poate fi util in cazul replicarii.
Cristian Andrei Lefter, SQL Server MVP
MCT, MCSA, MCDBA, MCAD, MCSD .NET,
MCTS, MCITP - Database Administrator SQL Server 2005
http://sqlserver.ro