Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
>>>If the String PK/FK approach is really ugly and just a BAD idea, I could use this as an opportunity to refactor over to an Integer based approach.
>>
>>Using strings as a PK is not ugly. In fact, in many projects I use GUIDs instead of integer primary keys. GUIDs do have many advantages over integers. I wouldn't, though, refactor a system to use GUIDs if it's currently integer values unless I have a strong business case.
>>
>>However, from what I understand is that you are ignoring the PK in your tables and instead are using other fields to link data, because those fields are the fields that the user enters. That's something I'd avoid.
>
>Hi Christof,
>
>Would you please list all the advantages vs. disadvantages of GUID vs. Integer (in your opinion)?
>
>Thanks in advance.
PMFJI -- here are the main advantage and disadvantages. The disadvantages are GUIDs take up more space and are slightly slower to process, neither of which is a major issue IMO. The advantage is GUIDs are guaranteed to be globally unique (that's what the G stands for), which can be important if data is spread across servers.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement