John John
John John

Reputation: 1

storing a GUID inside sql server 2008 R2

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

Answers (2)

Thorsten Dittmar
Thorsten Dittmar

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

Related Questions