Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
[no name] 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?
k@ran 20-Nov-12 11:40am    
not both are sql table

1 solution

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
SQL
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900