Results 1 to 5 of 5

Thread: int primary key

  1. #1
    Join Date
    May 2003

    Unanswered: int primary key


    I have a database that was created in SQL Server 2000 I presume, although I am not certain.
    I am used to creating primary keys on identity columns.
    This table however had the fields s_collineage, s_generation etc which I believe created for replicated databases.
    Is it safe to remove them?
    Also, the primary key in this field is an int columns with a default value of 0.
    Whenever a new record is created, that field is populated with a random int value. I don't understand how this value is generated. I checked the column properties but cannot figure it out.
    Any help would be greatly appreciated.


  2. #2
    Join Date
    Nov 2004
    Provided Answers: 4
    Can you give us all the DDL scripts of this table and it fields?
    With kind regards . . . . . SQL Server 2000/2005/2012

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Jun 2003
    Provided Answers: 1
    See if there is a trigger on the table that sets the primary key value.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

  4. #4
    Join Date
    Feb 2004
    One Flump in One Place
    Stating the obvious perhaps, but have you checked that the application is not generating the PK values?
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    May 2003
    I think i know why this is happening.
    This used to be an access database i believe setup for replication. When that is done all autonumbers are changed to just ints to prevent the duplicated auto incremented numbers.
    I checked the sql server database and it is not setup for replication. Maybe they just ran the wizard to upgrade to sql, not sure.
    I will just change the fields to autonumbers again and mark the relationships to cascade update.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts