简体   繁体   中英

Slow Access Append Query

I have a query, A , in my ms-access database that takes ~2 seconds to execute. A gives me six fields: Field1 , Field2 , ..., Field6 .

I must append the results of A to a table, T .

I created a query, B , that selects columns from A and inserts them into table T . However, B takes more than 10 minutes to run... Why? and How do I speed-up B ?

Here is the code for B :

INSERT INTO TrialRuns (Field1,Field2,...,Field6)
SELECT A.Field1,A.Field2,...,Field6
From A

Try something like this:

INSERT INTO TrialRuns SELECT * FROM A;

Try;

SELECT A.Field1,A.Field2,...,Field6 INTO TrialRuns FROM A

Note that this may only work if you make sure that the TrialRuns table doesn't exist to begin with, so do a DROP TABLE TrialRun beforehand if it does exist. This should take as long to run as the initial SELECT statement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM