Class SqlServerExtensions
Inheritance
SqlServerExtensions
Assembly: FluentMigrator.Extensions.SqlServer.dll
Syntax
public static class SqlServerExtensions
Fields
ConstraintType
Declaration
public static readonly string ConstraintType
Field Value
DataCompression
Declaration
public static readonly string DataCompression
Field Value
IdentityIncrement
Declaration
public static readonly string IdentityIncrement
Field Value
IdentityInsert
Declaration
public static readonly string IdentityInsert
Field Value
IdentitySeed
Declaration
public static readonly string IdentitySeed
Field Value
IncludesList
Declaration
public static readonly string IncludesList
Field Value
IndexColumnNullsDistinct
Declaration
public static readonly string IndexColumnNullsDistinct
Field Value
IndexFilter
Declaration
public static readonly string IndexFilter
Field Value
OnlineIndex
Declaration
public static readonly string OnlineIndex
Field Value
RowGuidColumn
Declaration
public static readonly string RowGuidColumn
Field Value
SchemaAuthorization
Declaration
public static readonly string SchemaAuthorization
Field Value
SparseColumn
Declaration
public static readonly string SparseColumn
Field Value
UniqueConstraintFilter
Declaration
public static readonly string UniqueConstraintFilter
Field Value
UniqueConstraintIncludesList
Declaration
public static readonly string UniqueConstraintIncludesList
Field Value
Methods
Authorization(ICreateSchemaOptionsSyntax, string)
Sets the schema owner during schema creation
Declaration
public static ICreateSchemaOptionsSyntax Authorization(this ICreateSchemaOptionsSyntax expression, string owner)
Parameters
Returns
Clustered(ICreateConstraintOptionsSyntax)
Declaration
public static ICreateConstraintOptionsSyntax Clustered(this ICreateConstraintOptionsSyntax expression)
Parameters
Returns
Filter(ICreateConstraintOptionsSyntax, string)
Declaration
public static ICreateConstraintOptionsSyntax Filter(this ICreateConstraintOptionsSyntax expression, string filter)
Parameters
Returns
Filter(ICreateIndexOptionsSyntax, string)
Declaration
public static ICreateIndexOptionsSyntax Filter(this ICreateIndexOptionsSyntax expression, string filter)
Parameters
Returns
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(ICreateConstraintOptionsSyntax, string)
Declaration
public static ICreateConstraintOptionsSyntax Include(this ICreateConstraintOptionsSyntax expression, string columnName)
Parameters
Returns
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 ICreateConstraintOptionsSyntax NonClustered(this ICreateConstraintOptionsSyntax expression)
Parameters
Returns
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
Sparse(ICreateTableColumnOptionOrWithColumnSyntax)
Declaration
public static ICreateTableColumnOptionOrWithColumnSyntax Sparse(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
WithDataCompression(ICreateIndexOptionsSyntax, DataCompressionType)
Declaration
public static ICreateIndexOptionsSyntax WithDataCompression(this ICreateIndexOptionsSyntax expression, DataCompressionType dataCompressionType)
Parameters
Returns
WithIdentityInsert(IInsertDataSyntax)
Inserts data using Sql Server's IDENTITY INSERT feature.
Declaration
public static IInsertDataSyntax WithIdentityInsert(this IInsertDataSyntax expression)
Parameters
Returns