Click here to Skip to main content
11,638,351 members (76,323 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET SQL-Server
How to upload data from one table to another table which has same stucture and field.

I have two same table. one is on local macine and another is on remote server.

On button click i need to remove data from local and upload data of local machine to remote machine ..

Their is one identity field on my table..
Posted 19-Nov-12 7:59am
Comments
Mathlab at 19-Nov-12 16:04pm
   
If I am understanding correctly the first table is in ASP.NET and the other is in the database SQL server?
mrinal_kumar_jha at 20-Nov-12 11:40am
   
not both are sql table

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could achieve it with several ways.

The first method contains the following steps
- link a remote server
http://msdn.microsoft.com/en-us/library/ms188279.aspx[^]
- delete data from local table
- insert data from linked server with
SET IDENTITY_INSERT
http://msdn.microsoft.com/en-us/library/ms188059.aspx[^]

Second after the remote server linking create merge statement for your update purposes http://msdn.microsoft.com/en-us/library/bb510625.aspx[^]

Third is to use MS SQL Server replication technology
http://msdn.microsoft.com/en-us/library/ms151198.aspx[^]

The third is a little bit complicated but very powerful technique.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 314
1 stibee 233
2 Suvendu Shekhar Giri 230
3 Richard Deeming 190
4 Mika Wendelius 178
0 OriginalGriff 9,061
1 Sergey Alexandrovich Kryukov 8,773
2 Mika Wendelius 7,027
3 Suvendu Shekhar Giri 2,494
4 F-ES Sitecore 2,438


Advertise | Privacy | Mobile
Web02 | 2.8.150728.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100