Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
INSERT INTO TABLE1 IN 'C:\DATABASE1.mdb'[Password=PASSWORD] SELECT * FROM TABLE1 IN 'C:\DATABASE2.mdb'[Password=PASSWORD]
Posted

SQL
INSERT INTO Table1
SELECT * FROM Table1 IN 'C:\DATABASE2.mdb';
 
Share this answer
 
v3
Comments
Subrata.Das.1959 21-Aug-14 23:33pm    
I am getting "Not a Valid Password" error. Please note that the Databse2 is password protected (Password=password)
ChauhanAjay 22-Aug-14 0:04am    
try this
INSERT INTO Table1
SELECT * FROM Table1 IN 'C:\DATABASE2.mdb' [;PWD=thePassword]
Subrata.Das.1959 22-Aug-14 0:13am    
Same error, "Not a valid Password" I am using it in VB2010 and MS Access 2010 (mdb format). Please help.
Basically if you are Using Sql Server Havng Two Databases . To Copy it from Database to Anotheir us ethe following query

Insert into DestinationDataBase..TableName(column Names)
select column Names from SourceDataBase..TableName

Note Avoid Inserting the Primary Key Values means auto increment[identity columns].if the table has foreign key , then it should have same primary data.

hope it helps you.
Happy Coding:-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900