Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What would be a better Primary Key?
Message
 
To
12/01/2006 23:07:34
General information
Forum:
Microsoft SQL Server
Category:
Database design
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01086425
Message ID:
01086513
Views:
17
Paul,
The situation you are describing screams uniqueidentifier to me. I started researching the uniqueidentifier filed type for my own project about 4 months ago and I was sold on the idea.

Sure uniqueidentifier takes up 8 bytes more than bigint and 12 bytes more than int (per record) and it is said to be slower (mostly in my opinion due to the fact that you have to send slightly more data over the wire).

How many records do you think there will be in the table(s)?

Is it important to know which branch the data came from?

Einar

>I am working on an app that will be used in multiple branch offices and then the data from all branches will be "consolidated" into a corporate database. Because of this I need to have a Primary key that will be unique among all branch offices.
>
>I can think of 2 choices the first being the uniqiueidentifier data type, or using a charater type with the primary key being BranchID0000001 etc.
>
>Any pro's or cons thoughts ideas would be welcome
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform