Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 communicating between 2 database

Author  Topic 

saurabhjj
Starting Member

13 Posts

Posted - 2007-11-05 : 13:38:50
i have two databases, each of them have 1 table each, both the tables have same schema, i want to copy records from one table into another,

can anyone please help me out

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-05 : 13:42:09
Use the three part naming convention for the remote object.

INSERT INTO DB1.dbo.Table1 (...)
SELECT ...
FROM DB2.dbo.Table1
...

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

saurabhjj
Starting Member

13 Posts

Posted - 2007-11-05 : 13:45:30
which file should i choose .mdf or .log
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-11-05 : 13:47:01
quote:
Originally posted by saurabhjj

which file should i choose .mdf or .log




what???



Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-11-05 : 13:48:24
You SELECT/INSERT into tables/(other objects) IN the database.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-05 : 13:48:25
quote:
Originally posted by saurabhjj

which file should i choose .mdf or .log




You don't reference the MDF or the LDF file in your queries, so I'm very confused why you are asking this.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-11-06 : 00:58:28
quote:
Originally posted by saurabhjj

which file should i choose .mdf or .log



You dont need to choose any files. Run the query suggested by Tara in Query Analyser

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -