Hi,
I have this table postcode with 122694 records and address table with 122691 records. I'm trying to delete all the records that exists in postcode table but not in address table. My SQL is "DELETE FROM [Postcode] WHERE [Postcode].[Postal_cd] NOT IN (SELECT [Postal_cd] FROM [Address])".
I wanted to estimate how many records it will affect, so I changed it to a SELECT query. Upon running in my VB application, it returns Timeout. Running in Query Analyzer for over 5 minutes still doesn't return any results.
I've added indexes to the field Postal_cd in both tables but the results are still the same.
Can anyone tell me what is wrong?
Thanks in advance!!
I have this table postcode with 122694 records and address table with 122691 records. I'm trying to delete all the records that exists in postcode table but not in address table. My SQL is "DELETE FROM [Postcode] WHERE [Postcode].[Postal_cd] NOT IN (SELECT [Postal_cd] FROM [Address])".
I wanted to estimate how many records it will affect, so I changed it to a SELECT query. Upon running in my VB application, it returns Timeout. Running in Query Analyzer for over 5 minutes still doesn't return any results.
I've added indexes to the field Postal_cd in both tables but the results are still the same.
Can anyone tell me what is wrong?
Thanks in advance!!