deleting full table gets "single row update/delete affected more than one row " error

T

tdr

I'm trying to run delete * from dbo_depend_table and i'm getting
"single row update/delete affected more than one row" why?

I can understand if I had a where clause, but I dont.

system info:
ms access 2000
ms sql server 2000

TIA
 
R

Rick Brandt

tdr said:
I'm trying to run delete * from dbo_depend_table and i'm getting
"single row update/delete affected more than one row" why?

I can understand if I had a where clause, but I dont.

system info:
ms access 2000
ms sql server 2000

TIA

That usually indicates that your server table has no primary key and no
unique indexes. When you created the link you were prompted to designate
which fields could be used by Access to identify unique rows and you
supplied a field (or fields) that are NOT actually unique on the table.

For example if I link to a table with no primary key that contains two
fields (FirstName and LastName) and I tell Access to use those fields to
build a local unique index (required to allow updates on such tables), then
I update the row having "John" and "Smith" in those two fields, I will
actually be applying that update to ALL of the rows on the server where
FirstName has "John" and LastName has "Smith".

It is best to actually have a PK or unique index on all of your server
tables, but if you don't and you tell Access to use one or more fields to
build a unique index on then you MUST correctly specify fields that are
actually unique. Otherwise you run a serious risk of trashing your data.
 
T

tdr

That usually indicates that your server table has no primary key and no
unique indexes. When you created the link you were prompted to designate
which fields could be used by Access to identify unique rows and you
supplied a field (or fields) that are NOT actually unique on the table.

For example if I link to a table with no primary key that contains two
fields (FirstName and LastName) and I tell Access to use those fields to
build a local unique index (required to allow updates on such tables), then
I update the row having "John" and "Smith" in those two fields, I will
actually be applying that update to ALL of the rows on the server where
FirstName has "John" and LastName has "Smith".

It is best to actually have a PK or unique index on all of your server
tables, but if you don't and you tell Access to use one or more fields to
build a unique index on then you MUST correctly specify fields that are
actually unique. Otherwise you run a serious risk of trashing your data.

thanks for the quick reply.

I tried to select columns when I linked the table, but that did not
work.
I select group, plan, start date, end date, first name , and last
name.
got the same error.

there really is not a unique record for this table, I'm bulk loading a
set of records that could contain some dups.
(which are ok the system that we are loading into will handle them ,
via it's own update)
 
T

tdr

thanks for the quick reply.

I tried to select columns when I linked the table, but that did not
work.
I select group, plan, start date, end date, first name , and last
name.
got the same error.

there really is not a unique record for this table, I'm bulk loading a
set of records that could contain some dups.
(which are ok the system that we are loading into will handle them ,
via it's own update)- Hide quoted text -

- Show quoted text -

I think i found the problem,
the Sql server did not have a index , I thought the table on the
server had one.
 
Joined
Oct 16, 2013
Messages
1
Reaction score
0
Hi,

I got a form working well when not connecting to SQL.
After I import and link tables to SQL , my form does not work any more.

The form I used is connected to a table, which has 1 index value.
when importing that table to Access, I set the index to be PK.
Whenever I add a new record to a textbox in the form, it just copy the previous record and dont keep my new record in. Even though I did use "Allow addition, Allow edit, Allow delete...

If I refresh the ODBC link, the PK of table is disappeared.
The form does not show any textbox to enter data.
I just can't input data in the form.

Any idea of how I can fix this problem?


After
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top