|
-
Aug 8th, 2002, 10:48 AM
#1
Thread Starter
Fanatic Member
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....
-
Aug 8th, 2002, 11:20 AM
#2
Fanatic Member
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
-
Aug 8th, 2002, 11:29 AM
#3
Thread Starter
Fanatic Member
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
-
Aug 8th, 2002, 02:59 PM
#4
Fanatic Member
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
-
Aug 8th, 2002, 03:22 PM
#5
Thread Starter
Fanatic Member
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.
-
Aug 8th, 2002, 03:28 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|