// ReSharper disable once InconsistentNaming public void TestBasicReplicateMSSQLToMSSQLPayrollTable() { using var replicator = new SqlClientDataReplicator <SqlClientSourceAdapter>( Settings.Default.SqlConnectionString, Settings.Default.SqlConnectionString2ndDatabase) { ParallelismLevel = 2 }; replicator.AddSourceTable(SelectTop1000FromPayrollOrderByIid); replicator.UseTransaction = true; replicator.ReplicateMode = SqlClientDataReplicator <SqlClientSourceAdapter> .ReplicateModes.TruncateAndPump; replicator.Prepare(); replicator.Replicate(3000, /*SqlClientAdapterBulkInsert.MaxPossibleBatchSize*/ 10); replicator.UnPrepare(); Assert.That.AreEqual <SqlClientSourceAdapter, SqlClientSourceAdapter>( Settings.Default.SqlConnectionString, SelectTop1000FromPayrollOrderByIid, Settings.Default.SqlConnectionString2ndDatabase, SelectAllFromPayrollOrderByIid); }
// ReSharper disable once InconsistentNaming public void TestBasicReplicateMSSQLToMSSQLUsingLiteralParameterBinding() { using var replicator = new SqlClientDataReplicator <SqlClientSourceAdapter>( Settings.Default.SqlConnectionString, Settings.Default.SqlConnectionString2ndDatabase) { ParallelismLevel = 2 }; replicator.AddSourceTable(SelectTop1000FromTimeOrderByIid); replicator.UseTransaction = true; replicator.ReplicateMode = SqlClientDataReplicator <SqlClientSourceAdapter> .ReplicateModes.DropTableAndPump; replicator.LiteralParamBinding = true; replicator.Prepare(); replicator.Replicate(3000, 50); replicator.UnPrepare(); Assert.That.AreEqual <SqlClientSourceAdapter, SqlClientSourceAdapter>( Settings.Default.SqlConnectionString, SelectTop1000FromTimeOrderByIid, Settings.Default.SqlConnectionString2ndDatabase, SelectAllFromTimeOrderByIid); }