Most efficient way to store a GUID value in SQL Server database

ahmd0 picture ahmd0 · Dec 30, 2011 · Viewed 23.8k times · Source

Say, if I need to store non-repeating GUID values (something like {AB50C41E-3814-4533-8F68-A691B4DA9043}) in the SQL Server database, what is the most efficient way to define the column to store it? (i.e. as string, a blob, or convert it into a 16-byte integer.)

PS. The column must be defined as an INDEX and be UNIQUE.

Answer

gbn picture gbn · Dec 30, 2011

Note, these are 2 separate steps