Page 1 of 1

Copy tables

Posted: Wed 28 Jul 2010 14:36
by Petya
Hello,

I wonder what's the simplest way to copy a table from one SQL Server to another replacing the destination, using SDAC 4.80.

Thanks, Peter

Posted: Wed 28 Jul 2010 15:51
by Dimon
You can use the TCRBatchMove component to copy data from one database to another.
You can find more detailed information about TCRBatchMove in the SDAC Help.

Posted: Wed 28 Jul 2010 17:19
by Petya
Tomorrow I'll try it.
Thanks !

Posted: Fri 30 Jul 2010 17:10
by Petya
It works fine, thanks.
Except for that I set
CRBatchMove1.AbortOnKeyViol:=false;
CRBatchMove1.AbortOnProblem:=false;
and it still stops and throws exceptions on such conditions.
Cannot it be overrided some way ?

Thanks, Peter

Posted: Mon 02 Aug 2010 08:52
by Dimon
Please give a more detailed description of the error that arises in your application.

Posted: Mon 02 Aug 2010 16:11
by Petya
Hi Dimon,

Unfortunately I don't have time momently to investigate this, therefore I solved it another way, regarding the fact that even 1 error makes my process to be unsuccessful.

My other question is there any way to stop the batchmove process programmatically during operation, for example using the OnBatchMoveProgress event ? I didn't find such method in the manual.

Thanks a lot,

Peter

Posted: Tue 03 Aug 2010 08:38
by Dimon
TCRBatchMove doesn't allow to stop process after starting execution.
But you can use the RecordCount property to determine the maximum number of records in the source dataset, that will be applied to the destination dataset.

Posted: Tue 03 Aug 2010 08:42
by Petya
Hi Dimon,

Can I tell TCRBatchMove to start over where it has left off anyway ?

Thanks for your answer,

Peter

Posted: Tue 03 Aug 2010 12:06
by Dimon
Set the RecordCount property. If RecordCount is greater than 0, up to the RecordCount records are applied to the destination dataset, starting from the current record in the source dataset.

Posted: Tue 03 Aug 2010 12:53
by Petya
So if I do nothing else to the DataSets than call Execute (optionally) again with RecordCount>0 until RecordCount>MovedCount, that's enough ? This method is safe enough ?

Posted: Tue 03 Aug 2010 13:23
by Dimon
Yes, you can use this method.