I have a question, clearly since I’m here…
I have a source database (SQL Server 2008) and a destination database (also SQL Server 2008). There are modifications which need to be done which means that a lot of the data has to pass through C# (converting coordinates, triangulation etc). But how would you do it?
I’m looking for a few things here. Right now I’m using a SqlDataReader and pulling the data into a DataTable and using the data like that in order to manipulate it before I push it into the destination database, but what would be a better (faster & more memory efficient) way of doing it?
Also, for data which does not need to be manipulated I’m still pulling it through in the same way, I assume there is a way of avoiding that which would be quicker?
Technical info:
- DB: 2 x SQL Server 2008 (source/dest) – On the same server
- Language: C# / .NET 3.5
- OS: Windows
I would insert the source data into a temp table(s) on to the destination database.
Then I would use SQL Merge to update the destination.
MERGE (Transact-SQL)
I would completely minimize the role that c# plays.