New Members FAQ
Talk to Webmaster Tony John
sunil kumar sharma
Copy data from one table to another table -different server.
10 Aug 2012
I hava a table in sql server 2000 db , recently I cloned this db to another
server and started as production db. after two days only we came to know one of the table has missed its data. I dontknow how it has missed all the data for this particular table. now this table is having arround 200 records whihc is created last two days. I want the data should be copied from the old table (it is having 500000 records and located in another server) into new table (200 records). this table is having a column ID as Identity column .
insert into method will take more time...is there any way to do as quick as possible.
Thanks & Regards,
Date: 10/Aug/2012 Rating:
There are many ways to do it
1. Insert statement
2. SSIS packages
3. Use sqlbulkcopy
if your table schema is same SQLBULKCopy is the easiest.
you can use this like
private static void ProductsCopy()
string strConnection =
// get the source data
using (SqlConnection srcConnection = new SqlConnection(strConnection))
SqlCommand srcCommand = new SqlCommand("SELECT * FROM Products");
srcCommand.Connection = srcConnection;
SqlDataReader reader = srcCommand.ExecuteReader();
// open the destination data
using (SqlConnection destConnection = new SqlConnection(strConnection))
// open the connection
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(destConnection.ConnectionString))
bulkCopy.BatchSize = 500;
bulkCopy.DestinationTableName = "Products_New";
Date: 10/Aug/2012 Rating:
You can do it using bulk copy option to get data from new server and insert into that deleted table easily if you don't want to write code then use SSMS tools pack tool to get insert statement of any number of record in small time. Just run that insert statement in deleted table to insert into it.
I have explained in details use of that tool in my below article please check this
Your Hard work never fails
to post a response.
Unable to execute the package through sql server agent job
How to update new row and sum of all the records in SQL SERVER
Return to Discussion Forum
Post New Message
Exporting SQL Server Table to Excel Using DTS
Function is not working
DATE SEARCH IN ASPX PAGE
Any body tell good pl sql book reference URL and FAQ
Follow us on Twitter:
Last 7 Days
Asheej T K
Awards & Gifts
Articles Rss Feeds
Forum Rss Feeds
Revenue Sharing sites
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.