I have an Access Database in which I need to update about 1500 out of 79000 entries in a given table. I've been presented with an Excel spreadsheet of the key ID's for which I need to modify a particular column.
It's basically re-assigning a different "Designer" to 1500 different clients.
I've found a useful tool called WinSQL Lite that allows me to run SQL against the Access database, and then used excel to produce a space-delimited text file with a list of UPDATE statements to change the specific entry, which looks like this:
UPDATE Leads SET Designer = 45 WHERE LeadNumber = 157776
UPDATE Leads SET Designer = 45 WHERE LeadNumber = 157784
UPDATE Leads SET Designer = 45 WHERE LeadNumber = 169561
The LeadNumber is different in each case.
Of course SQL isn't designed to run separate UPDATE queries like this, so I tried creating an SQL file with semi-colons to depict a different statement / query on each line, but this doesn't work either.
Now if I copy & paste each statement individually and run it - it does what I need. I just need a method to do this for the 1500 LeadNumbers. My investigation shows a way of nesting the statement into a loop with the different LeadNumbers listed within it but I couldn't work out any way of creating this list from the spreadsheet of ClientNumber's I've been provided.