[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

How to copy Table data from one database to another SQL

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
Grogel
Asked:
Grogel
  • 2
1 Solution
 
Bryan ButlerCommented:
0
 
GrogelAuthor Commented:
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
 
carsRSTCommented:
0
 
GrogelAuthor Commented:
Thank you.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now