wh0wants2know
IS-IT--Management
I have two tables, dbo_postalcode and ACI. some of the records in ACI may or may not be in dbo_postalcode, so what i want to do is insert only the values in ACI that are not present in dbo_postalcode into dbo_postalcode. my sql query is thus:
<code>
INSERT INTO dbo_PostalCodes ( PostalCode, City, State, CountryID, AirportID, ACIArea )
SELECT ACI.zip, ACI.city, ACI.state, ACI.CountryID, ACI.ID, ACI.zone
FROM ACI where not Exists (select * from dbo_PostalCodes where (dbo_PostalCodes.city = aci.city AND dbo_PostalCodes.state = aci.state And dbo_PostalCodes.postalcode = aci.zip and dbo_PostalCodes.airportID = aci.ID ) )
</code>
this thing runs for about five minutes and then crashes and nothing happens. dbo_postalcodes is a linked table from my sql server and ACI is an access table. ACI is about 45000 records and dbo_postalcodes is about 15000 records, there's probably an overlap of about 8000 records. is the even going to work this way, or do i need to do something different to make this happen? why is it crashing?
<code>
INSERT INTO dbo_PostalCodes ( PostalCode, City, State, CountryID, AirportID, ACIArea )
SELECT ACI.zip, ACI.city, ACI.state, ACI.CountryID, ACI.ID, ACI.zone
FROM ACI where not Exists (select * from dbo_PostalCodes where (dbo_PostalCodes.city = aci.city AND dbo_PostalCodes.state = aci.state And dbo_PostalCodes.postalcode = aci.zip and dbo_PostalCodes.airportID = aci.ID ) )
</code>
this thing runs for about five minutes and then crashes and nothing happens. dbo_postalcodes is a linked table from my sql server and ACI is an access table. ACI is about 45000 records and dbo_postalcodes is about 15000 records, there's probably an overlap of about 8000 records. is the even going to work this way, or do i need to do something different to make this happen? why is it crashing?