copy contents from databases
I use 'insert into table1 select * from table2' to copy contents from one table to another when they are in the same database.
But how do I do that if the tables are in different databases. I am using ADO's in VB. Do I need to open both the databases and then use the statement?
Thanks
Re: copy contents from databases
it probably depends on your backend.
If your database is SQLServer you do not need to open both databases. Just open the target database and issue a statement like
insert into table1 select * from database.owner.tablename
you can even use the following syntax to insert from another server
insert into table1 exec server.database.owner.spName