Solved

How to copy Table data from one database to another SQL

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Syntax Error subtracting two select statements. 5 15
Round up to 100% in .NET 10 43
Get String split 5 32
using t-sql EXISTS 8 23
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now