Reputation: 1
I am retrieving the active directory GUID for AD users, the GUID is a 16 bytes long as mentioend on this link LINK . But can anyone adivse what is the best data type for storing this GUID inside my sql server 2008 R2 database, as I will need to search the related table for this GUID very frequently?
Upvotes: 1
Views: 1224
Reputation: 14460
Use can use uniqueidentifier and index the column.
Also have a look at What are the best practices for using a GUID as a primary key, specifically regarding performance?
Upvotes: 2
Reputation: 56697
It would be most intuitive to use the uniqueidentifier
type and put an index on it. The uniqueidentifier
type is exactly made to stored GUIDs.
Upvotes: 2