Class SqlServerExtensions
Inheritance
SqlServerExtensions
Assembly: FluentMigrator.Extensions.SqlServer.dll
Syntax
public static class SqlServerExtensions
Fields
ConstraintType
Declaration
public const string ConstraintType = "SqlServerConstraintType"
Field Value
IdentityIncrement
Declaration
public const string IdentityIncrement = "SqlServerIdentityIncrement"
Field Value
IdentityInsert
Declaration
public const string IdentityInsert = "SqlServerIdentityInsert"
Field Value
IdentitySeed
Declaration
public const string IdentitySeed = "SqlServerIdentitySeed"
Field Value
IncludesList
Declaration
public const string IncludesList = "SqlServerIncludes"
Field Value
IndexColumnNullsDistinct
Declaration
public const string IndexColumnNullsDistinct = "SqlServerIndexColumnNullsDistinct"
Field Value
OnlineIndex
Declaration
public const string OnlineIndex = "SqlServerOnlineIndex"
Field Value
RowGuidColumn
Declaration
public const string RowGuidColumn = "SqlServerRowGuidColumn"
Field Value
Methods
Clustered(ICreateConstraintOptionsSyntax)
Declaration
public static void Clustered(this ICreateConstraintOptionsSyntax expression)
Parameters
Identity<TNext, TNextFk>(IColumnOptionSyntax<TNext, TNextFk>, int, int)
Makes a column an Identity column using the specified seed and increment values.
Declaration
public static TNext Identity<TNext, TNextFk>(this IColumnOptionSyntax<TNext, TNextFk> expression, int seed, int increment) where TNext : IFluentSyntax where TNextFk : IFluentSyntax
Parameters
Type |
Name |
Description |
IColumnOptionSyntax<TNext, TNextFk> |
expression |
Column on which to apply the identity.
|
int |
seed |
Starting value of the identity.
|
int |
increment |
Increment value of the identity.
|
Returns
Type Parameters
Name |
Description |
TNext |
|
TNextFk |
|
Identity<TNext, TNextFk>(IColumnOptionSyntax<TNext, TNextFk>, long, int)
Makes a column an Identity column using the specified seed and increment values with bigint support.
Declaration
public static TNext Identity<TNext, TNextFk>(this IColumnOptionSyntax<TNext, TNextFk> expression, long seed, int increment) where TNext : IFluentSyntax where TNextFk : IFluentSyntax
Parameters
Type |
Name |
Description |
IColumnOptionSyntax<TNext, TNextFk> |
expression |
Column on which to apply the identity.
|
long |
seed |
Starting value of the identity.
|
int |
increment |
Increment value of the identity.
|
Returns
Type Parameters
Name |
Description |
TNext |
|
TNextFk |
|
Include(ICreateIndexOnColumnSyntax, string)
Declaration
public static ICreateIndexNonKeyColumnSyntax Include(this ICreateIndexOnColumnSyntax expression, string columnName)
Parameters
Returns
Include(ICreateIndexOptionsSyntax, string)
Declaration
public static ICreateIndexOptionsSyntax Include(this ICreateIndexOptionsSyntax expression, string columnName)
Parameters
Returns
NonClustered(ICreateConstraintOptionsSyntax)
Declaration
public static void NonClustered(this ICreateConstraintOptionsSyntax expression)
Parameters
NullsDistinct(ICreateIndexColumnUniqueOptionsSyntax, bool)
Column should have unique values. Only one row with null value should be accepted (default for most known database engines).
Declaration
public static ICreateIndexColumnUniqueOptionsSyntax NullsDistinct(this ICreateIndexColumnUniqueOptionsSyntax expression, bool nullsAreDistinct = true)
Parameters
Returns
NullsDistinct(ICreateIndexMoreColumnOptionsSyntax, bool)
Column should have unique values. Only one row with null value should be accepted (default for most known database engines).
Declaration
public static ICreateIndexOnColumnSyntax NullsDistinct(this ICreateIndexMoreColumnOptionsSyntax expression, bool nullsAreDistinct = true)
Parameters
Returns
NullsNotDistinct(ICreateIndexColumnUniqueOptionsSyntax)
Column should have unique values, but multiple rows with null values should be accepted.
Declaration
public static ICreateIndexColumnUniqueOptionsSyntax NullsNotDistinct(this ICreateIndexColumnUniqueOptionsSyntax expression)
Parameters
Returns
NullsNotDistinct(ICreateIndexMoreColumnOptionsSyntax)
Column should have unique values, but multiple rows with null values should be accepted.
Declaration
public static ICreateIndexOnColumnSyntax NullsNotDistinct(this ICreateIndexMoreColumnOptionsSyntax expression)
Parameters
Returns
Online(ICreateConstraintOptionsSyntax, bool)
Specifies whether underlying tables and associated indexes are available for queries and data modification during the index operation.
The ONLINE option can only be specified in certain situations, please refer to documentation for SQL Server 2005 and newer.
Declaration
public static ICreateConstraintOptionsSyntax Online(this ICreateConstraintOptionsSyntax expression, bool active = true)
Parameters
Type |
Name |
Description |
ICreateConstraintOptionsSyntax |
expression |
The expression to use to set the WITH(ONLINE=) option
|
bool |
active |
true
Long-term table locks are not held. This allows queries or updates to the underlying table to continue.
false
Table locks are applied and the table is unavailable for the duration of the index operation.
|
Returns
Online(ICreateIndexOptionsSyntax, bool)
Specifies whether underlying tables and associated indexes are available for queries and data modification during the index operation.
The ONLINE option can only be specified in certain situations, please refer to documentation for SQL Server 2005 and newer.
Declaration
public static ICreateIndexOptionsSyntax Online(this ICreateIndexOptionsSyntax expression, bool active = true)
Parameters
Type |
Name |
Description |
ICreateIndexOptionsSyntax |
expression |
The expression to use to set the WITH(ONLINE=) option
|
bool |
active |
true
Long-term table locks are not held. This allows queries or updates to the underlying table to continue.
false
Table locks are applied and the table is unavailable for the duration of the index operation.
|
Returns
Online(IDeleteConstraintInSchemaOptionsSyntax, bool)
Specifies whether underlying tables and associated indexes are available for queries and data modification during the index operation.
The ONLINE option can only be specified in certain situations, please refer to documentation for SQL Server 2005 and newer.
Declaration
public static IDeleteConstraintInSchemaOptionsSyntax Online(this IDeleteConstraintInSchemaOptionsSyntax expression, bool active = true)
Parameters
Type |
Name |
Description |
IDeleteConstraintInSchemaOptionsSyntax |
expression |
The expression to use to set the WITH(ONLINE=) option
|
bool |
active |
true
Long-term table locks are not held. This allows queries or updates to the underlying table to continue.
false
Table locks are applied and the table is unavailable for the duration of the index operation.
|
Returns
Online(IDeleteIndexOptionsSyntax, bool)
Specifies whether underlying tables and associated indexes are available for queries and data modification during the index operation.
The ONLINE option can only be specified in certain situations, please refer to documentation for SQL Server 2005 and newer.
Declaration
public static IDeleteIndexOptionsSyntax Online(this IDeleteIndexOptionsSyntax expression, bool active = true)
Parameters
Type |
Name |
Description |
IDeleteIndexOptionsSyntax |
expression |
The expression to use to set the WITH(ONLINE=) option
|
bool |
active |
true
Long-term table locks are not held. This allows queries or updates to the underlying table to continue.
false
Table locks are applied and the table is unavailable for the duration of the index operation.
|
Returns
RowGuid(ICreateTableColumnOptionOrWithColumnSyntax)
Declaration
public static ICreateTableColumnOptionOrWithColumnSyntax RowGuid(this ICreateTableColumnOptionOrWithColumnSyntax expression)
Parameters
Returns
UniqueNullsDistinct(ICreateIndexOptionsSyntax, bool)
Index should have unique values. Only one row with null value should be accepted (default for most known database engines).
Declaration
public static ICreateIndexOnColumnSyntax UniqueNullsDistinct(this ICreateIndexOptionsSyntax expression, bool nullsAreDistinct = true)
Parameters
Type |
Name |
Description |
ICreateIndexOptionsSyntax |
expression |
The expression to set this option for
|
bool |
nullsAreDistinct |
true when nulls should be distinct
|
Returns
UniqueNullsNotDistinct(ICreateIndexOptionsSyntax)
Index should have unique values, but multiple rows with null values should be accepted.
Declaration
public static ICreateIndexOnColumnSyntax UniqueNullsNotDistinct(this ICreateIndexOptionsSyntax expression)
Parameters
Returns
WithIdentityInsert(IInsertDataSyntax)
Inserts data using Sql Server's IDENTITY INSERT feature.
Declaration
public static IInsertDataSyntax WithIdentityInsert(this IInsertDataSyntax expression)
Parameters
Returns