Re: Generate Random Primary Key

From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 06/04/04


Date: Fri, 4 Jun 2004 13:36:02 +0100

If the values exceed the maximum for the column then you can widen the
column by making it a BIGINT or NUMERIC. If the column has a Primary Key
constraint then you'll need to drop it first and redeclare it afterwards.
That should be easier than trying to generate random keys.

-- 
David Portas
SQL Server MVP
--


Relevant Pages

  • Re: MS Access 2007 closes and errors when clicking on last record
    ... I have adp's in use with BigInt primary keys and foreign keys, ... Was BigInt a feature introduced with SQL 2005, or it existed in SQL 2000? ... Sylvain Lafontaine, ing. ... >> the primary key or creating the new records if more than one table is ...
    (microsoft.public.access.adp.sqlserver)
  • Problem reciving xml element
    ... CONSTRAINT Soknadsskjemaer_pk PRIMARY KEY ) ... ID bigint IDENTITYNOT NULL, ... CREATE TABLE Checklister ...
    (microsoft.public.sqlserver.xml)
  • Clientdataset have a problem with SQL Server data type Bigint ?
    ... make the type of primary key back to bigint and begin to debug the application. ... Well, if you look at the PutConstant function, you will see that ... with TClientDataset and Bigint fields from Sql? ...
    (borland.public.delphi.database.ado)
  • Re: Need a little help please
    ... Every table should have a primary key. ... A lack of indexes and constraints doesn't affect the insert per se. ... David Portas ... SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Change data type int to Bigint
    ... Primary key on products table is type BigInt, foriegn key on Fact table is ... type Int. ... will have multiple servers generating product IDS, ...
    (microsoft.public.sqlserver.programming)