SQL Query that works with two dbs
I have two databases, (in MS-SQL)
I want to insert the data of the first db into the second db usuing an sql query.
Or let me explain in this way, can I work with two connections in one SQL query?
# 1 Re: SQL Query that works with two dbs
I'm not sure you can do that. A solution could be to link one of the tables in one of the databases and query two tables in the same db.
# 2 Re: SQL Query that works with two dbs
I have found a solution: Linked Severs
'graye' (http://home.hot.rr.com/graye) said:
Using SQL Server, you can create a "Linked Server" to the other database. This makes the remote database appear as if it's attached to the SQL server.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_1_server_4uuq.asp
After that, you can just pretent the two databases are local to the SQL Server and perform whatever inserts, deletes, selects, etc using the server.owner.database notation
You can almost do the same thing with Microsoft Access using it's "Linked Tables" feature... but doing it on SQL Server is "mo betta"