Solved

How to copy Table data from one database to another SQL

Posted on 2011-09-13
4
284 Views
Last Modified: 2012-05-12
Hi.

Can you tell me how to copy table data from one database to another.

Each of database is on different Server.

Example:

I need to copy data from Table1 on   server1\sqlexpress to Table2 which is on server2\sqlexpress.

Databases are identical in structure.
I know how to copy with Microsoft SQL Managment studio Right click on database--> Export data. But i need code solution that will be executed from VB Program.

Thank you in advance.

P.S. I will never need old data from server2 so let's say that destination table will be empty.
0
Comment
Question by:Grogel
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 36530239
0
 

Author Comment

by:Grogel
ID: 36530310
Is there some other way, simpler. Something like  insert (Select * from table1 on database1) into table2 on database2 - something like that?

I can load data in datagrid, and than insert row by row into another database but I was hoping for nicer solution.
0
 
LVL 16

Accepted Solution

by:
carsRST earned 500 total points
ID: 36530325
0
 

Author Closing Comment

by:Grogel
ID: 36530407
Thank you.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question