Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }