Append Query

K

Karan

Hi,

Can i do the following - Please Suggest.

1). If i need to append three tables at a time, do i need to create the
three different Append Query or I can do this at one Append Query with the
selection of Three Tables.

2). I want to know, once the data is copied to the destination table, it
looks perfect. But, When i enter new records in a table and then perform
the action of Append Query,
a). Will it Copy only the New Records
b). Will it Copy All the Records
c). Or I need to Re-Create Append Query everytime i add new records.

3). Is there anyway i can run this Append Query(s) when i open the database
(or) at a particular time schedule.

Can you clarify this things.

Thanks and have a nice day !!

Karan.
 
P

Pieter Wijnen

Comments interjected

HTH
Pieter

Karan said:
Hi,

Can i do the following - Please Suggest.

1). If i need to append three tables at a time, do i need to create the
three different Append Query or I can do this at one Append Query with the
selection of Three Tables.
You will need 3 selects but you can use a union query to have only one
append query for all 3 tables
2). I want to know, once the data is copied to the destination table, it
looks perfect. But, When i enter new records in a table and then perform
the action of Append Query,
a). Will it Copy only the New Records
b). Will it Copy All the Records
c). Or I need to Re-Create Append Query everytime i add new records.
If you have an unique constraint on the destination table (to prevent
duplicates ) you can run the same query safely "forever", however it would
be cleaner to build it so that dups will be filtered out beforehand (left
join to destination - or using exists
example:
INSERT INTO DEST (KeyField, Field1,Field2...)
SELECT KeyField, Field1, Field2 .. FROM SOURCE1 A
WHERE NOT EXISTS (SELECT 'X' FROM DEST D WHERE D.KeyField = A.KEYFIELD)
UNION ALL

SELECT KeyField, Field1, Field2 .. FROM SOURCE2 A
WHERE NOT EXISTS (SELECT 'X' FROM DEST D WHERE D.KeyField = A.KEYFIELD)
....
3). Is there anyway i can run this Append Query(s) when i open the database
(or) at a particular time schedule.
you can do it in the autoexec macro / startup form and/or in a forms timer
event
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Append Query 1
Append only Null records in table 2
Append Queries in 2007 5
Append Query 3
Append Query 1
Wierd Append error 6
Append only new records with an append Query 1
Append Query writing multiple records. 4

Top