void DeleteMissingEntriesOnce() { if (WasDeletionExecuted == true) { return; } WasDeletionExecuted = true; if (DisableDeletion == true) { return; } var deletions = InputData.Where(row => String.IsNullOrEmpty(row.ChangeAction)); if (UseTruncateMethod) { TruncateTableTask.Truncate(this.ConnectionManager, TableName); } else { SqlDeleteIds(deletions); } DeltaTable.AddRange(deletions); DeltaTable.ForEach(row => { row.ChangeAction = "D"; row.ChangeDate = DateTime.Now; }); }
public void TestLogging() { CreateLogTablesTask.CreateLog(); TruncateTableTask.Truncate("dbo.TRC"); Assert.IsTrue(new SqlTask("Find log entry", "select count(*) from etl.Log where TaskAction = 'START' and TaskType='TRUNCATE'") { DisableLogging = true }.ExecuteScalarAsBool()); }
public void TruncateTableLogging() { //Arrange CreateSimpleTable("etl.TruncateTableLog"); //Act TruncateTableTask.Truncate(SqlConnection, "etl.TruncateTableLog"); //Assert Assert.Equal(2, CountLogEntries("TruncateTableTask")); }
public void Truncate(IConnectionManager connection) { //Arrange TwoColumnsTableFixture tableDef = new TwoColumnsTableFixture(connection, "TruncateTableTest"); tableDef.InsertTestData(); Assert.Equal(3, RowCountTask.Count(connection, "TruncateTableTest")); //Act TruncateTableTask.Truncate(connection, "TruncateTableTest"); //Assert Assert.Equal(0, RowCountTask.Count(connection, "TruncateTableTest")); }
private void TruncateDestinationOnce() { if (WasTruncationExecuted == true) { return; } WasTruncationExecuted = true; if (MergeMode == MergeMode.NoDeletions || MergeMode == MergeMode.OnlyUpdates) { return; } TruncateTableTask.Truncate(this.ConnectionManager, TableName); }
private void TruncateDestinationOnce() { if (WasTruncationExecuted == true) { return; } WasTruncationExecuted = true; if (MergeMode == MergeMode.InsertsAndUpdatesOnly || MergeMode == MergeMode.UpdatesOnly) { return; } TruncateTableTask.Truncate(this.ConnectionManager, TableName); }
void DeleteMissingEntriesOnce() { var deletions = InputData.Where(row => row.ChangeAction == 0); if (DisableDeletion == false && WasDeletionExecuted == false) { if (UseTruncateMethod) { TruncateTableTask.Truncate(TableName); } else { SqlDeleteIds(deletions); } } DeltaTable.AddRange(deletions); DeltaTable.ForEach(row => { row.ChangeAction = 'D'; row.ChangeDate = DateTime.Now; }); WasDeletionExecuted = true; }
public void TestTruncate() { Assert.AreEqual(3, RowCountTask.Count("dbo.TRC")); TruncateTableTask.Truncate("dbo.TRC"); Assert.AreEqual(0, RowCountTask.Count("dbo.TRC")); }