I need to take several tables with their data from a SQL Server Express and send them to another computer and create or replace them there in a SQL Server Standard Edition with C#.
I have been looking for a solution and the closest I’ve found is to recover the tables in DataTables or DataSets and send them with WCF, but I think I’ll lose the indexes and I’ve read that it’s not recommended to send DataSets with WCF.
I have also taken a look at Microsoft Sync Framework, but I haven’t worked with it and I don’t know if it could solve this easily. Another way I’ve been told to do it is to export the tables and indexes to a SQL script.
My question is: is there an easy way to do this? If not, which is the less painful way to do it?
Edit: Sorry, I forgot to mention that:
-This will happen once or twice a week.
-The machines are not in the same network.
-Eventually, the structure of the tables may change.
If you want to do it from C#, use SMO (SQL Server Management Objects).
Here you have a sample to tansfer schema and data between two databases.
Transferring Data
This project shows how to use it for a table:
Copy a table using SQL Server Management Objects