Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: What's the most efficient primary key ?

Re: What's the most efficient primary key ?

From: BP Margolin <bpmargo_at_attglobal.net>
Date: Sat, 21 Jul 2001 23:07:04 GMT
Message-ID: <3b0e7e77_3@news3.prserv.net>

remco,

Since you have included the comp.database.ms-sqlserver newsgroup in your post, I'll offer a SQL Server specific solution:

SQL Server supports the IDENTITY property, which automatically generates the next value in a arithmetic progression ... with seed and increment values of 1 and 1, the sequence generated is 1, 2, 3, ...

An INTEGER can support values from -2,147,483,648 through 2,147,483,647, thus offering over 4 billion unique values. If that's not enough, SQL Server 2000 has a BIGINT data type that supports values from -9223372036854775808 through 9223372036854775807.



BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which can be cut and pasted into Query Analyzer is appreciated.

"worldonline" <remco.van.toor_at_iquality.nl> wrote in message news:9elo7s$sf2$1_at_nereid.worldonline.nl...
> I want to create billions of unique key, wat's the best option?
>
> a compound key containing several integer-columns,
> a large datatype (decimal)
> or a string perhaps ??
>
> i would like the first options, it is good for using OID's
>
>
> thanks in advance,
> remco
>
>
>
Received on Sat Jul 21 2001 - 18:07:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US