CreateIndexTask

Class CreateIndexTask

Creates an index if the index doesn't exists, otherwise the index is dropped and recreated.

Inheritance
CreateIndexTask
Implements
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
    public sealed class CreateIndexTask : ControlFlowTask, ILoggableTask
Examples
CreateIndexTask.Create("indexname","tablename", indexColumns)

Constructors

CreateIndexTask()

Declaration
    public CreateIndexTask()

CreateIndexTask(string, string, IList<string>)

Declaration
    public CreateIndexTask(string indexName, string tableName, IList<string> indexColumns)
Parameters
TypeNameDescription
stringindexName
stringtableName
IList<string>indexColumns

CreateIndexTask(string, string, IList<string>, IList<string>)

Declaration
    public CreateIndexTask(string indexName, string tableName, IList<string> indexColumns, IList<string> includeColumns)
Parameters
TypeNameDescription
stringindexName
stringtableName
IList<string>indexColumns
IList<string>includeColumns

Properties

IN

The formatted name of the index

Declaration
    public ObjectNameDescriptor IN { get; }
Property Value
TypeDescription
ObjectNameDescriptor

IncludeColumns

A list of included column names for the index.

Declaration
    public IList<string> IncludeColumns { get; set; }
Property Value
TypeDescription
IList<string>

IndexColumns

A list of column names for the index

Declaration
    public IList<string> IndexColumns { get; set; }
Property Value
TypeDescription
IList<string>

IndexName

The name of the index

Declaration
    public string IndexName { get; set; }
Property Value
TypeDescription
string

IsClustered

Set the index as a clustered index

Declaration
    public bool IsClustered { get; set; }
Property Value
TypeDescription
bool

IsUnique

Set the index as Unique.

Declaration
    public bool IsUnique { get; set; }
Property Value
TypeDescription
bool

Sql

The sql code used to generate the index

Declaration
    public string Sql { get; }
Property Value
TypeDescription
string

TN

The formatted name of the table.

Declaration
    public ObjectNameDescriptor TN { get; }
Property Value
TypeDescription
ObjectNameDescriptor

TableName

The name of the table the index is based on.

Declaration
    public string TableName { get; set; }
Property Value
TypeDescription
string

Methods

CreateOrRecreate()

Runs the sql to (re)create the index on a table.

Declaration
    public void CreateOrRecreate()

CreateOrRecreate(IConnectionManager, string, string, IList<string>)

Creates an index. If the index exists, it is dropped and recreated.

Declaration
    public static void CreateOrRecreate(IConnectionManager connectionManager, string indexName, string tableName, IList<string> indexColumns)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

stringindexName

The name of the index

stringtableName

The name of the table the index is based on

IList<string>indexColumns

The name of the columns for the index

CreateOrRecreate(IConnectionManager, string, string, IList<string>, IList<string>)

Creates an index. If the index exists, it is dropped and recreated.

Declaration
    public static void CreateOrRecreate(IConnectionManager connectionManager, string indexName, string tableName, IList<string> indexColumns, IList<string> includeColumns)
Parameters
TypeNameDescription
IConnectionManagerconnectionManager

The connection manager of the database you want to connect

stringindexName

The name of the index

stringtableName

The name of the table the index is based on

IList<string>indexColumns

The name of the columns for the index

IList<string>includeColumns

The name of the columns that are included in the index.

CreateOrRecreate(string, string, IList<string>)

Creates an index. If the index exists, it is dropped and recreated.

Declaration
    public static void CreateOrRecreate(string indexName, string tableName, IList<string> indexColumns)
Parameters
TypeNameDescription
stringindexName

The name of the index

stringtableName

The name of the table the index is based on

IList<string>indexColumns

The name of the columns for the index

CreateOrRecreate(string, string, IList<string>, IList<string>)

Creates an index. If the index exists, it is dropped and recreated.

Declaration
    public static void CreateOrRecreate(string indexName, string tableName, IList<string> indexColumns, IList<string> includeColumns)
Parameters
TypeNameDescription
stringindexName

The name of the index

stringtableName

The name of the table the index is based on

IList<string>indexColumns

The name of the columns for the index

IList<string>includeColumns

The name of the columns that are included in the index

Implements