JD2775 Posted September 28, 2011 Posted September 28, 2011 Hi there, I have a Table with about 5 fields in it, including one Serial Number field which just increments by 1. The one other unique ID field is the EU_ID field, which is a 9 digit unique number. I have a script that imports data from Excel into this table. How can I set it so if a EU_ID already exists in the database, it can't be added again? I tried changing the EU_ID field to "Unique Value, Custom Message if Failed" and that didnt work. I am assuming it didnt work because that would only catch if the EU_ID was duplicated in the same Excel sheet. Any ideas? Thanks
Kilyaaan Posted September 28, 2011 Posted September 28, 2011 When you import you can set to 'Update matching records in found set' - (making sure that you have Found all records before you start the import ) this will not create new records but merely update old existing ones. If you cant live with the import updating the other data in already existing records, with that from the excell file, you'll need to make a dummy import table. Import the excell to the dummy, find and delete all the records you already have, and then make a second import from this to real Table. Well this was way off - read comment's reply instead :)
comment Posted September 29, 2011 Posted September 29, 2011 How can I set it so if a EU_ID already exists in the database, it can't be added again? Set the validation to "Unique, Validate always".
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now