Hi all,

i want to transfer data one sql database to another database in same sql server. i try to insert into table2 select * from table1 , but this query useful for same database, but i want to use different database, in same sql server.

help me here to solve this problem,

mrugesh

Re: Data transfer from one database to another database 80 80

Use database backup.

Re: Data transfer from one database to another database 80 80

This query copies the table "madExcept" from the "Bugs" database to the "ShotgunHill" database:

Select * Into ShotgunHill..madExcept From Bugs..madExcept

Doing this does not recreate the table properly in the destination database though. Many table constraints, such as Primary Key, will not be set up properly when you select into another table. You are better off to use backups/restore as adatapost mentioned.

Re: Data transfer from one database to another database 80 80

This query copies the table "madExcept" from the "Bugs" database to the "ShotgunHill" database:

Select * Into ShotgunHill..madExcept From Bugs..madExcept

Doing this does not recreate the table properly in the destination database though. Many table constraints, such as Primary Key, will not be set up properly when you select into another table. You are better off to use backups/restore as adatapost mentioned.

Hi thr,

THANK YOU VERY MUCH TO GIEV RESPONSE, BUT I GET MY OLUTION BY MYSELF, AND MY APPLICATION WORK PROPERLY.

THANKS ONCE AGAIN.

MRUGESH

Re: Data transfer from one database to another database 80 80

i want to transfer millions of records from Microst SQL To Another Microsoft SQL Provided with a Pause Button.When The Application Close .After the Application Open It Should Show Resume and transfer the Data

Re: Data transfer from one database to another database 80 80

Use bulk copy, from microsoft, can be found in odbc reference api, dblib, ctlib etc, it comes in many forms, early version came as a command bcp, than dblib now is masked on top of odbc or oledb, just write some code in order to make a bulk copy, for me worked, 10 millions records in aprox. 1 minute

Re: Data transfer from one database to another database 80 80

Use Backup of old DB and then restore it into new DB

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.