How would I write a query to attach (or join) 2 databases (main1 and temp1) and then insert the records from temp1.table1 into main1.table1.
It is easy when in the same database - "INSERT INTO table1 SELECT * FROM table2" - (structure same of course). I hope it is as easy as example above (after attaching database) with
"INSERT INTO main1.[table1] SELECT * FROM temp1.[table2]"
I need to insert new records into tables in my distributed app. I don't want to overwrite the database to get my new records in since it already contains data the user has entered.
So I thought I would supply a mirror database (MyTemp), containing only new records to insert into various tables. When insertion is complete, I will empty each table in MyTemp. On next app start, I will run the function to insert new, but all tables are empty in MyTemp so nothing will get inserted...
Thanks
It is easy when in the same database - "INSERT INTO table1 SELECT * FROM table2" - (structure same of course). I hope it is as easy as example above (after attaching database) with
"INSERT INTO main1.[table1] SELECT * FROM temp1.[table2]"
I need to insert new records into tables in my distributed app. I don't want to overwrite the database to get my new records in since it already contains data the user has entered.
So I thought I would supply a mirror database (MyTemp), containing only new records to insert into various tables. When insertion is complete, I will empty each table in MyTemp. On next app start, I will run the function to insert new, but all tables are empty in MyTemp so nothing will get inserted...
Thanks