Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 cant delete

Author  Topic 

jhermiz

3564 Posts

Posted - 2004-01-07 : 17:22:37
I open up a table..to delete a row...
actually a few rows..
I get an error message

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

So the row doesnt delete..the table has no Primary Key..nor foreign keys..so whats sql server complaining about?

Thanks,
Jon

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-07 : 17:54:06
Are you deleting from Enterprise Manager? I assume so since you say open up. Do the delete in Query Analyzer. Enterprise Manager has many limitations.

Tara
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2004-01-08 : 00:37:55
>>So the row doesnt delete..the table has no Primary Key..nor foreign keys..so whats sql server complaining about?


That's exactly what it's complaining about. It can't uniquely identify the rows that need to be deleted, since every row is like every other row in the table without a primary key. Think about it, how would you write a query to delete those few rows from the table without specifying a WHERE clause? Delete rows 1, 5 and 9 ...in an RDBMS which has no concept of a row order?

Use QA to delete those rows and watch your WHERE clause

OS
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-01-08 : 08:10:24
Why should it matter...there is no relationships, no foreign or primary keys...there is NO uniqueness to the row set. So yes it works in QA with DELETE * FROM tblName...I think EM was poorly written. There was no need for a where clause, I wanted all the rows deleted from the table. If it works in QA it should work for EM.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-01-08 : 08:18:05
quote:
Why should it matter...there is no relationships, no foreign or primary keys...there is NO uniqueness to the row set.
Practically speaking, you don't have a real table here. It's just a heap of data. Relational databases are designed to work with IDENTIFIABLE data, naturally they have problems when there's no way to identify it. If these are the kinds of tables you want, store them in Excel instead.
quote:
So yes it works in QA with DELETE * FROM tblName...
So what's the problem? You should be using QA to modify data anyway. Stop using EM to do this kind of work.
quote:
I think EM was poorly written.
Not much argument from anyone.
quote:
There was no need for a where clause, I wanted all the rows deleted from the table.
Like you said, it works in QA, use QA.
quote:
If it works in QA it should work for EM.
Why not use the right tool for the job, instead of complaining about how the wrong tool doesn't work correctly?
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-01-08 : 08:30:04
Cause the wrong tool would be a lot better if it actually was written correctly. If one specific piece of SQL Server does one thing then another piece should work exactly the same, not give me an error message. Sure it works in QA but it should also work in EM.

If I create 2 small GUIS for my application as a wizard one with a treeview control and another with list boxes. Once the wizard has completed the results (if the end user makes the same selections) should be exactly the same and should not be affected based on what GUI he / she uses. It should be a matter of preference...

If I don't complain about it who is ? How are bugs going to be fixed or features be enhanced if everyone just accepts everything. Anyone even MS should take the criticism and make a better product next time.
Go to Top of Page

drymchaser
Aged Yak Warrior

552 Posts

Posted - 2004-01-08 : 08:35:17
What about TRUNCATE TABLE?
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-01-08 : 08:36:41
EM is as bad as Crystal Reports
Well then again ... NOT Crystal Reports has got to be the dirtiest reporting tool I've ever used
Go to Top of Page
   

- Advertisement -