Class CreateIndexTask

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

Inheritance
object
CreateIndexTask
Implements
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.ControlFlow
Assembly: ETLBox.dll
Syntax
    public sealed class CreateIndexTask : ControlFlowTask, ILoggableTask
Examples
CreateIndexTask.Create("indexname","tablename", indexColumns)

Constructors

CreateIndexTask()

Declaration
    public CreateIndexTask()
Examples
CreateIndexTask.Create("indexname","tablename", 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
System.Collections.Generic.IList<T><string>indexColumns
System.Collections.Generic.IList<T><string>includeColumns
Examples
CreateIndexTask.Create("indexname","tablename", indexColumns)

CreateIndexTask(string, string, IList<string>)

Declaration
    public CreateIndexTask(string indexName, string tableName, IList<string> indexColumns)
Parameters
TypeNameDescription
stringindexName
stringtableName
System.Collections.Generic.IList<T><string>indexColumns
Examples
CreateIndexTask.Create("indexname","tablename", indexColumns)

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
System.Collections.Generic.IList<T><string>

IndexColumns

A list of column names for the index

Declaration
    public IList<string> IndexColumns { get; set; }
Property Value
TypeDescription
System.Collections.Generic.IList<T><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

TableName

The name of the table the index is based on.

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

TaskName

A name to identify the task or component. Every component or task comes with a default name that can be overwritten.

Declaration
    public override string TaskName { get; set; }
Property Value
TypeDescription
string
Overrides

TN

The formatted name of the table.

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

Methods

CreateOrRecrate()

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

Declaration
    public void CreateOrRecrate()

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

System.Collections.Generic.IList<T><string>indexColumns

The name of the columns for the index

System.Collections.Generic.IList<T><string>includeColumns

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

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

System.Collections.Generic.IList<T><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

System.Collections.Generic.IList<T><string>indexColumns

The name of the columns for the index

System.Collections.Generic.IList<T><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

System.Collections.Generic.IList<T><string>indexColumns

The name of the columns for the index

Implements