Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-06-28 : 07:38:48
|
| Frank writes "I'm currently on a project that was taken over from another consulting firm. After an initial look at the database design, we discovered that they were using partial GUIDs (the last 12 chars) as primary keys througout most of the tables which leads to my question. What are the chances that we will eventually generate a duplicate 12 character key using this sort of design? Does anyone know the exact breakdown of the GUID so I can better understand how it is generated?Thanks for you time." |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-06-28 : 08:29:10
|
| I believe that GUIDs use the MAC address, so that part would be constant on a given server. However, I haven't noticed the first 20 characters being constant in my GUIDs so I reckon you are out of luck.Is this a problem at the Application end (e.g. only 12 character field provided in forms etc.) 'coz if they are storing 12 characters in CHAR now, in the DB, then a UNIQUEIDENTITY data type is only going to be 4 bytes more. I expect if you prefix all existing values with 20 ZEROs and convert them to UNIQUEIDENTITY you would not create a colision with any data calculated in the future, but I don't know that for sure!.I presume there was a Good Reason for this design decision?!Kristen |
 |
|
|
|
|
|