Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write data from one database to another

Status
Not open for further replies.

me1411

Technical User
Jan 9, 2009
1
Hello
I have two databases.
I want to take data from a table of the 1-st database
and
write them to a table of the second database.
Thank you.
 
How are ya me1411 . . .

This can also be done with an [blue]action query[/blue]. Note, in the SQL:
[ol][li] [purple]tblDes[/purple] is the destination table name of the current db where the query is run.[/li]
[li][purple]tblSrc[/purple] is the source table name from the source db.[/li][/ol]
Code:
[blue]INSERT INTO tblDes ( desFieldName1, desFieldName2, ... desFieldNameN ) 
SELECT tblSrc.srcFieldName1, srcFieldName2 ... srcFieldNameN 
FROM tblSrc [purple][b]IN 'Path and FileName to Src mdb'[/b][/purple];[/blue]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top