Access SQL Insert

  • Thread starter Thread starter Looch
  • Start date Start date
L

Looch

I'm somewhat new to SQL but have been at it for a few weeks now

When i run the following query i get the 'cannot append due to lock
violations, key violations...etc'

insert into mitsudates (rolloutID)
select rollout.rolloutID
from mitsudates, rollout
where mitsudates.serialnumber = rollout.column_4x6_serial

rollout.rolloutid and mitsudates.rolloutid is a one to many
relationship (rollout-->mitsudates if it matters(?))

rollout.rolloutid is a primary key, i've tried it set as an autonumber
and number

All contraints for both fields in each table are the same looking at
each table in design view.

Help!
 
One thing that can cause problems when attempting to insert records is a
default value of zero on numeric data types, where this field is the foreign
key in a relationship with enforced referential integrity. If you do not
insert a valid value into such a field, referential integrity constraints
will prevent you from inserting the record.

Also look for potential trouble spots with any fields indexed with unique =
Yes. In this case, you are not allowed to insert a record with a duplicate
value.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
One thing that can cause problems when attempting to insert records is a
default value of zero on numeric data types, where this field is the foreign
key in a relationship with enforced referential integrity. If you do not
insert a valid value into such a field, referential integrity constraints
will prevent you from inserting the record.

Also look for potential trouble spots with any fields indexed with unique =
Yes. In this case, you are not allowed to insert a record with a duplicate
value.

Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/e...http://www.access.qbuilt.com/html/search.html
__________________________________________
Tom, thanks for your response. I was actually trying to update, though didn't know it at the time, and got it to work.

Thanks again!
 

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

Similar Threads


Back
Top