Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2006
    Posts
    15

    Unanswered: i cant delete a row

    i cant delete a row on my table. when i click delete it say : "Insufficient key column information for updating or refreshing......" what can i do?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The message smells like you might be using Microsoft Access to edit a table stored in Microsoft SQL, but that you don't have all of the defined key columns in the edit control. If that is correct:

    1. Verify that there is a defined key
    1a. Should be a PRIMARY KEY definition
    1b. Could be a UNIQUE constraint
    1c. Might be a UNIQUE INDEX
    2. Identify all columns in all of the potential defined key(s) from step 1.
    3. Ensure that all of the columns from at least one of the defined keys are present in your edit control.

    -PatP

  3. #3
    Join Date
    Mar 2006
    Posts
    15
    thanks but i didnt use access. i copy and paste a row in my table. then i wanted to delete that row but i cant delete. all of my other rows can be cleaned but that row cant be delete.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Nope, it isn't possible to "copy and paste a row in my table" because there isn't any GUI representation for a table. What you are doing (very possibly without realizing it) is copying and pasting within some application running on your machine, not actually on the table itself.

    Since you haven't given us (the readers) many clues, but you have ruled out Microsoft Access, I'll make another guess... This time I'll guess Captain Peacock, in the Drawing Room... Oh wait, wrong game!

    Let's try this guess: Are you possibly using SQL Enterprise Manager, and Editing a table grid control? If so, please let me know and we can start to solve your problem... If not, I might try to guess again!

    Just in case you didn't get the idea, I'm frustrated. You're asking me to help you solve a problem, but you haven't given me anything concrete to work from. I assume that you are using SQL Server, and that you haven't used it very much so you're handicapped in explaining your problem, and it appears that English isn't your native language which would further complicate things for you... I'm trying to help, but I need you to help me more so that I can help you!

    If you can read English comfortably, please see this forum's FAQ for Brett Kaiser's excellent suggestions for How to Ask a Question to Get Quick and Correct Answers.

    -PatP

  5. #5
    Join Date
    Mar 2006
    Posts
    15
    yes! you are right. im sorry. now i am using sql server 2000 enterprise manager. i create a table (same nortwind "order details"). remember i create an olap cube such as nwind
    here is my fields:

    accountno (varchar50)
    medicineno(nvarchar15)
    saleprice(float8)
    quantity(float8)

    i click return all rows and enter my records

    1 101 $4 3
    1 102 $3 2
    2 102 $5 3
    3 207 $2 1
    ..........................
    56 101 $4 2

    and then i copy this row (2 102 $3 2) and paste it

    ...............................
    56 101 $4 2
    2 102 $3 2

    then i wanted to delete that row (2 102 $3 2)
    but it cant be deleted. warning: "key column info insufficient or wrong. updating affects more rows" (i translated english. maybe it can be wrong)

  6. #6
    Join Date
    Jan 2005
    Location
    Green Bay
    Posts
    201
    Have dealt with this in the past dealing with others issues.

    You need to write a delete statment to accomplish this in query analyzer.

    delete from table where accountno = 2

    try inserting a new row as follows

  7. #7
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    The problem stems from the fact that you do not have a unique primary key defined on your table. Thus, when you try to delete one record SQL Server cannot tell which record it is.
    Add a primary key to your table. A surrogate key will do fine. But I also agree that you should not edit data from the Enterprise Manager GUI. Use Query Analyzer.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  8. #8
    Join Date
    Mar 2006
    Posts
    15
    thanks i will try

Posting Permissions

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