Copy data from One database to Another database:
There are various options to copy data from one database to another database.
1. First Option -> We will think about is - Using DTS wizard.
2. Second Option -> We can go for SSIS packages.
3. Thirst Option -> A very simple query as below,
Table and data created in VenkatDB will be moved to SubaDB
USE VENKATDB
CREATE TABLE VENKAT_TABLE(ID INT,NAME VARCHAR(100))
INSERT INTO VENKAT_TABLE VALUES(1,'VENKAT')
INSERT INTO VENKAT_TABLE VALUES(2,'SUBA')
SELECT * FROM VENKAT_TABLE
USE SubaDB
SELECT * INTO VENKAT_TABLE1 FROM VenkatDB.dbo.VENKAT_TABLE
A new table venkat_table1 will be created in te second DB with all the records populated in the second table in the second DB.
Cheers,
Venkatesan Prabu .J
No comments:
Post a Comment