Solved

How to copy Table data from one database to another SQL

Posted on 2011-09-13
4
285 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.Net creating Contact in Outlook 1 49
How to open a different table using the same bindingsource - vb.net 3 63
Parse this column 6 34
sql query 5 43
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
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.

735 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