Class CalculateDatabaseHashTask
Calculates a hash value of the database. It will use only the schemas given in the property SchemaName for the calculation. The hash calcualtion is based only on the user tables in the schema.
Implements
Inherited Members
Namespace: ETLBox.ControlFlow.Tasks
Assembly: ETLBox.dll
Syntax
public class CalculateDatabaseHashTask : ControlFlowTask, ILoggableTask
Examples
CalculateDatabaseHashTask.Calculate(new List<string>() { "demo", "dbo" });
Constructors
CalculateDatabaseHashTask()
Declaration
public CalculateDatabaseHashTask()
CalculateDatabaseHashTask(List<String>)
Declaration
public CalculateDatabaseHashTask(List<string> schemaNames)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | schemaNames |
Properties
DatabaseHash
A unique hash value that can identify a database based on it's object
Declaration
public string DatabaseHash { get; }
Property Value
Type | Description |
---|---|
System.String |
SchemaNames
List of schema names that should be included in the database hash calculation
Declaration
public List<string> SchemaNames { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
Sql
The sql code generated to calculate the database hash value
Declaration
public string Sql { get; }
Property Value
Type | Description |
---|---|
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
Type | Description |
---|---|
System.String |
Overrides
Methods
Calculate()
Declaration
public CalculateDatabaseHashTask Calculate()
Returns
Type | Description |
---|---|
CalculateDatabaseHashTask |
Calculate(IConnectionManager, List<String>)
Calculates the hash of a database based on the existing database objects (Sql Server only)
Declaration
public static string Calculate(IConnectionManager connectionManager, List<string> schemaNames)
Parameters
Type | Name | Description |
---|---|---|
IConnectionManager | connectionManager | The connection manager of the database you want to connect |
System.Collections.Generic.List<System.String> | schemaNames | List of schema names that should be included in the hash calculation |
Returns
Type | Description |
---|---|
System.String | A unique hash values for the schema |
Calculate(List<String>)
Calculates the hash of a database based on the existing database objects (Sql Server only)
Declaration
public static string Calculate(List<string> schemaNames)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | schemaNames | List of schema names that should be included in the hash calculation |
Returns
Type | Description |
---|---|
System.String | A unique hash values for the schema |
Execute()
Runs the sql code to execute the database hash
Declaration
public void Execute()