Example #1
0
 public void TestAlterView()
 {
     CRUDViewTask.CreateOrAlter("test.View2", "select 1 as Test");
     Assert.IsTrue(SqlTask.ExecuteScalarAsBool("Check if view exists", "select count(*) from sys.objects where type = 'V' and object_id = object_id('test.View2') and create_date = modify_date"));
     CRUDViewTask.CreateOrAlter("test.View2", "select 5 as Test");
     Assert.IsTrue(SqlTask.ExecuteScalarAsBool("Check if view exists", "select count(*) from sys.objects where type = 'V' and object_id = object_id('test.View2') and create_date <> modify_date"));
 }
Example #2
0
 public void TestLogging()
 {
     CreateLogTablesTask.CreateLog();
     CRUDViewTask.CreateOrAlter("test.View3", "select 1 as Test");
     Assert.AreEqual(4, new SqlTask("Find log entry", "select count(*) from etl.Log where TaskType='CRUDVIEW' group by TaskHash")
     {
         DisableLogging = true
     }.ExecuteScalar <int>());
 }
Example #3
0
 public void TestCreateView()
 {
     CRUDViewTask.CreateOrAlter("test.View1", "select 1 as Test");
     Assert.IsTrue(SqlTask.ExecuteScalarAsBool("Check if view exists", "select count(*) from sys.objects where type = 'V' and object_id = object_id('test.View1')"));
 }