GUIDs: Not Necessarily Unique

So, you though that GUIDs were supposed to be unique, eh? You aren’t alone. A lot of people assume that GUIDs are unique. Hell, unique is in the name! On Friday, I had a bug report filed about a UNIQUE constraint violation. Seeing as how I had bigger fish to fry, and this functionality is only rarely used, I put it aside until this morning when I took a closer look at the bug report and the code in question. The table in question looks something like this:``` CREATE TABLE dbo.Widget ( WidgetId BIGINT IDENTITY(1,1) NOT NULL, – other columns LegacyIdentifier VARCHAR(50) NOT NULL );