Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

Re: problem using identity column as primary key

Tip: Looking for answers? Try searching our database.



You are accessing this site in a read-only mode. For full access to all member benefits, including message posting, please login or register. Registration is completely free, simple, and takes only a few seconds.

Login | Free SQLMonster.com registration | Whole discussion thread

The message you are replying to and its parents are listed in the reverse order with the most recent posts first. This might not be the whole discussion thread. To read all the messages in this thread please click here.

Re: problem using identity column as primary key

Bob Boran24 Feb 2004 15:53
Identity is a great way of generating a primary key.  Yes, there is a high
potential of having 'holes' in the sequence (though if that is a serious
problem it can be overcome).  For the most part, having all you primary key
values in a clean sequence without and holes is not an issue, as the only
purpose of the PK is to have a unique value.

I for one have never had an issue of running out of IDs.  considering that
you can use a bigint ( -9223372036854775808 to +9223372036854775807), there
is not much chance of running out.

> Hi,
>     I am thinking of creating an identity column to use it as primary key in
[quoted text clipped - 7 lines]
> thanks...
> -Nikhil

Nikhil Patel24 Feb 2004 15:55
Hi,
   I am thinking of creating an identity column to use it as primary key in
my table. But the problem is that once I delete some records, the SQL Server
would not reuse the IDs of the deleted records. So there will be holes in
the sequence. I know many people use Identity columns to generate unique id.
How do they deal with the holes in the identity columns? Do I need to worry
about the size of the identity column or whether or not the column would run
out of IDs or any other problem?

thanks...
-Nikhil

Quick links:

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage




©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.