>>Hi Borislav
>>
>>You realize you're hitting the backend/table 3 times? Once to grab the record, once to send the update and once to grab the new ID?
>>
>>That's the kind of thing DBAs complain about.
>>
>>By using GUID there are no extra round trips required to get new ids.
>
>No, only two times, send insert command and grab newly created id for that record. I am not sure is DBAs will be most happy when I create a 36 bites GUID instead of 4 bites Integer. I will have 4 bites transfer when I ask about new Id, and 4 bites for every single records when I want some recordset, but if I use GUID I will have 32 more bites to transfer for every record in the same recordset, isn't it?
2 times then. OK. :)
By the way GUID is 16 bytes. It is gaining popularity. GUID or UUID.
http://www.sqlteam.com/item.asp?ItemID=283Don't forget database purists insist on having a compound key. Just take INVOICE # and PRODUCT # and you're up to who knows how many bytes and that's before you get to a third table.
Don't forget FoxPro people used to use 10 bytes before integer. That was no where near unique enough, but it was common, even with multi-million record tables.
The PK is supposed to guarantee uniqueness. No question. Int only does that within a limited scope.