Append Query

  • Thread starter Thread starter Karan
  • Start date Start date
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.
 
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
 
Back
Top