5

Could you kindly tell me whether there is a most convenient way to copy table data from oracle to SQL Server?

My only idea is iterate all rows and do insert operation. That means i should write lots of code.

I want to know may I use DataSet/DataAdapter or other convenient C# methods to do migration?

PS. under C#/.NET2.0 env.

Thanks indeed.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user622851
  • 177
  • 2
  • 13

1 Answers1

2

This is really going to depend on how much data you are working with and what you want to accomplish.

If there isn't a lot of data, you can do things the really quick and dirty way and read the entire set into memory via a DataSet, then simply insert record by record into SQL Server. That will work as long as you don't have a massive amount of data to move.

Now, if you have more data, you can go a bit more streamlined to avoid the "in memory" hit and do things using a DataReaders and only read in line by line, a bit more code, but not all that much, maybe 20-30 lines.

Now, depending on your needs, SQL Server Edition, etc you could also use SSIS to pull it in and not write any code. This is a post that shows some about the performance of this process.

Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173
  • I know. Thanks very much. The amount of records is not huge. Because the backup operation is a part of the entire logic. So i will write c# code to do so, will not use outer tools. As you say, I will do this through iterating the dataSet. Thanks again for your rapid and awesome answer. Yours, jay. – user622851 Jul 07 '11 at 06:23