Copy Pasting Queries

KitaYama

Well-known member
Local time
Today, 23:09
Joined
Jan 6, 2022
Messages
2,250
I need a new query(query2) to use for a specific situation.

I know I have another query (query1), with a very similar structure of what I need. Instead of starting from scratch, I select query1, CTRL+C to copy and then CTRL+V to paste.
This ends to having a copy of query1. I change the name of the new query and either edit the sql or do some modifications in design view and I'm done.

I've noticed the following 2 situations in this process:

situation 1:
query1 returns a few record. Few hundred or few thousands. the copy paste is done in no time. Very quick. No problem here.

situatiuon2:
query1 returns several millions records. In this case, copying query1 takes a very long long time. at times 20 minutes or even more and at times Access becomes un-responding. Pasting it so super fast.

My question:
What exactly happens when I copy a query. Is Access copying the records? Is Access trying to validate data in query? What exactly Access is trying to achieve? A query is a simple object with a sql as its source. Why copying a query needs a long long time?

Important notes:
1- BE is sql server.
2- query1 structure : tblProducts (1→M) tblOrders (1→M) tblProcess
3- If I open query1, it opens in less than a second. If I click the icon at the bottom of the query to go to the end of 5 million records, it takes 2 or 3 seconds.

Thanks for your thoughts.
 
Last edited:
I also encounter that, as If it is copying a Table (data and structure).
maybe just copy the SQL string and paste it on the new query.
 
I also encounter that, as If it is copying a Table (data and structure).
maybe just copy the SQL string and paste it on the new query.
Yes, I've ended up to this solution, but sometimes I hit ctrl+c out of habit and I should wait a long time or terminate Access from task manager. I simply thought there must be a reason behind this.
 

Users who are viewing this thread

Back
Top Bottom