Class CreateIndexTask

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

Inheritance
System.Object
CreateIndexTask
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ETLBox.ControlFlow.Tasks
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
System.StringindexName
System.StringtableName
System.Collections.Generic.IList<System.String>indexColumns

CreateIndexTask(String, String, IList<String>, IList<String>)

Declaration
    public CreateIndexTask(string indexName, string tableName, IList<string> indexColumns, IList<string> includeColumns)
Parameters
TypeNameDescription
System.StringindexName
System.StringtableName
System.Collections.Generic.IList<System.String>indexColumns
System.Collections.Generic.IList<System.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
System.Collections.Generic.IList<System.String>

IndexColumns

A list of column names for the index

Declaration
    public IList<string> IndexColumns { get; set; }
Property Value
TypeDescription
System.Collections.Generic.IList<System.String>

IndexName

The name of the index

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

IsClustered

Set the index as a clustered index

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

IsUnique

Set the index as Unique.

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

Sql

The sql code used to generate the index

Declaration
    public string Sql { get; }
Property Value
TypeDescription
System.String

TableName

The name of the table the index is based on.

Declaration
    public string TableName { get; set; }
Property Value
TypeDescription
System.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
System.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>)

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

System.StringindexName

The name of the index

System.StringtableName

The name of the table the index is based on

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

System.StringindexName

The name of the index

System.StringtableName

The name of the table the index is based on

System.Collections.Generic.IList<System.String>indexColumns

The name of the columns for the index

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

The name of the index

System.StringtableName

The name of the table the index is based on

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

The name of the index

System.StringtableName

The name of the table the index is based on

System.Collections.Generic.IList<System.String>indexColumns

The name of the columns for the index

System.Collections.Generic.IList<System.String>includeColumns

The name of the columns that are included in the index

Implements