Results 1 to 6 of 6

Thread: can't delete records or rows from SQL Server

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    can't delete records or rows from SQL Server

    I have a table that is not connected in any way to any other tables.
    it has 5 fields of character type invarchar and int

    i can't delete or add records to it. I was able to add a few but now when I try I get an error message saying

    Key column information is insufficient or incorrect. Too many rows were affected by update.

    what?

    I tried to create a new table, thinking i could just delete the first one but i get the same error message....
    pnj

  2. #2
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    Add a unique index on the table. If each row is not unique, then your table is not normalized and you need to rethink your design.
    Code:
    CREATE UNIQUE
    INDEX index_name ON table (column [,...n])
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    do you mean something like an auto incrementing row?

    or a primary key?

    I'm trying that right now....
    Last edited by pnj; Aug 8th, 2002 at 11:45 AM.
    pnj

  4. #4
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    Yes, a primary key is what I'm talking about. If you can create one using the columns already in your table, then I would suggest doing that before adding an Identity column to your table, as it can be flaky sometimes (or so I hear).
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    i ended up just re-upsizeing it from access.

    i couldn't the primary key the way i thought i should.

    or rather, i couldn't add the relationships i needed to.

    so i did it in access and re-upsized it. it works fine now.


    that's why i was asking about saving sprocs in the other post.

    thanks again.
    pnj

  6. #6
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Sometimes, our identity columns will break and we get the same error you just described (and in rare cases, the data starts duplicating itself).

    In these cases, we usually drop the identity column and recreate it.

    You may not have this as an option, however, if the identity column is your relational column.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

Posting Permissions

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



Click Here to Expand Forum to Full Width