public void Execute() { if (!DbConnectionManager.SupportSchemas) { throw new ETLBoxNotSupportedException("This task is not supported!"); } bool schemaExists = new IfSchemaExistsTask(SchemaName) { ConnectionManager = this.ConnectionManager, DisableLogging = true }.Exists(); if (!schemaExists) { new SqlTask(this, Sql).ExecuteNonQuery(); } }
public void Execute() { if (ConnectionType == ConnectionManagerType.SQLite) { throw new ETLBoxNotSupportedException("This task is not supported with SQLite!"); } if (ConnectionType == ConnectionManagerType.MySql) { throw new ETLBoxNotSupportedException("This task is not supported with MySql! To create a database, use the CreateDatabaseTask instead."); } bool schemaExists = new IfSchemaExistsTask(SchemaName) { ConnectionManager = this.ConnectionManager, DisableLogging = true }.Exists(); if (!schemaExists) { new SqlTask(this, Sql).ExecuteNonQuery(); } }