CreateDatabaseTask
Class CreateDatabaseTask
Will create a database if the database doesn't exists. In MySql or MariaDb, this will create a schema.
Implements
Inherited Members
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
Examples
CreateDatabaseTask.Create("DemoDB");
Constructors
CreateDatabaseTask()
Declaration
CreateDatabaseTask(string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | databaseName |
CreateDatabaseTask(string, string)
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | databaseName | |
string | collation |
Properties
Collation
The default collation for the database
Declaration
Property Value
Type | Description |
---|---|
string |
ON
Declaration
Property Value
Type | Description |
---|---|
ObjectNameDescriptor |
ObjectName
The name of the database (In MySql: The schema name)
Declaration
Property Value
Type | Description |
---|---|
string |
RecoveryModel
Sql Server only: The recovery model of the database
Declaration
Property Value
Type | Description |
---|---|
RecoveryModel |
Sql
The sql code that is used to generate the database
Declaration
Property Value
Type | Description |
---|---|
string |
Methods
Create()
Runs the sql code to create the database. Throws an exception if the database already exists.
Declaration
Create(IConnectionManager, string)
Creates a database. In MySql or MariaDb, this will create a schema. Will throw an exception if the database already exists.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the server you want to connect. Make sure this points to a database that does exist (e.g. a system database) |
string | databaseName | The name of the database |
Create(IConnectionManager, string, string)
Creates a database. In MySql or MariaDb, this will create a schema. Will throw an exception if the database already exists.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the server you want to connect. Make sure this points to a database that does exist (e.g. a system database) |
string | databaseName | The name of the database |
string | collation | The default collation of the database. |
Create(string)
Creates a database. In MySql or MariaDb, this will create a schema. Will throw an exception if the database already exists. Make sure that your default connection string points to the server itself and to an existing database (e.g. a system database).
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | databaseName | The name of the database |
Create(string, string)
Creates a database. In MySql or MariaDb, this will create a schema. Will throw an exception if the database already exists. Make sure that your default connection string points to the server itself and to an existing database (e.g. a system database).
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | databaseName | The name of the database |
string | collation | The default collation of the database. |
CreateIfNotExists()
Runs the sql code to create the database if the database doesn't exist yet.
Declaration
CreateIfNotExists(IConnectionManager, string)
Creates a database if the database doesn't exists. In MySql or MariaDb, this will create a schema.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the server you want to connect. Make sure this points to a database that does exist (e.g. a system database) |
string | databaseName | The name of the database |
CreateIfNotExists(IConnectionManager, string, string)
Creates a database if the database doesn't exists. In MySql or MariaDb, this will create a schema.
Declaration
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the server you want to connect. Make sure this points to a database that does exist (e.g. a system database) |
string | databaseName | The name of the database |
string | collation | The default collation of the database. |
CreateIfNotExists(string)
Creates a database if the database doesn't exists. In MySql or MariaDb, this will create a schema. Make sure that your default connection string points to the server itself and to an existing database (e.g. a system database).
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | databaseName | The name of the database |
CreateIfNotExists(string, string)
Creates a database if the database doesn't exists. In MySql or MariaDb, this will create a schema. Make sure that your default connection string points to the server itself and to an existing database (e.g. a system database).
Declaration
Parameters
Type | Name | Description |
---|---|---|
string | databaseName | The name of the database |
string | collation | The default collation of the database. |