Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Column Class

The Column object represents a SQL Server column.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
public final class Column extends ScriptNameObjectBase implements ISfcSupportsDesignMode, ICreatable, IAlterable, IDroppable, IMarkForDrop, IExtendedProperties, IRenamable

The Column type exposes the following members.

  NameDescription
Public methodColumn()Initializes a new instance of the Column class.
Public methodColumn(SqlSmoObject, String)Initializes a new instance of the Column class that has the specified parent and specified name.
Public methodColumn(SqlSmoObject, String, DataType)Initializes a new instance of the Column class that has the specified parent and specified name.
Public methodColumn(SqlSmoObject, String, DataType, Boolean)Initializes a new instance of the Column class that uses the specified parent, datayype, and optionally adding the FILESTREAM attribute.
Top
  NameDescription
Public propertyAnsiPaddingStatusGets a Boolean property value that specifies whether the ANSI_PADDING_ENABLED column option is active.
Public propertyCollationGets or sets the default collation that is used by the column.
Public propertyComputedGets the Boolean property value that specifies whether the column is the product of computed expression
Public propertyComputedTextGets or sets the Transact-SQL expression that is used to generate the value of a computed column
Public propertyDataTypeGets or sets the data type that is assigned to the column.
Public propertyDefaultGets or sets the default bound to the column.
Public propertyDefaultConstraintGets a default value for the column.
Public propertyDefaultSchemaGets or sets the default schema that is bound to the column.
Public propertyExtendedPropertiesRepresents a collection of ExtendedProperty objects. Each ExtendedProperty object represents an extended property for the Column object.
Public propertyIDGets the column ID that uniquely identifies the column.
Public propertyIdentityGets or sets the Boolean property value that specifies whether the column is an identity column.
Public propertyIdentityIncrementGets or sets the identity increment for an identity column.
Public propertyIdentitySeedGets or sets the identity seed for an identity column.
Public propertyInPrimaryKeyGets the Boolean property value that specifies whether the column is included in the definition of a primary key or unique key constraint.
Public propertyIsColumnSetGets or sets a Boolean value that specifies whether the column is a sparse column that is a member of a column set.
Public propertyIsDeterministicGets or sets the Boolean property value that specifies whether the value of a computed column can change in subsequent invocations.
Public propertyIsFileStreamGets a boolean value that represents the FILESTREAM attribute of the column.
Public propertyIsForeignKeyGets the Boolean property value that specifies whether the column is a foreign key.
Public propertyIsFullTextIndexedGets the Boolean property value that specifies whether the column participates in a full-text index.
Public propertyIsPersistedGets the Boolean property value that specifies whether the computed value of the Column object is saved with the data, thus avoiding a computation each time the column is accessed.
Public propertyIsPreciseGets or sets the Boolean property value that specifies whether a computed column is a precise value.
Public propertyIsSparseGets or sets the Boolean property value that specifies whether this is a sparse column. For more information about sparse columns, see Use Sparse Columns.
Public propertyNameGets or sets a String value that specifies the name of the column. (Overrides NamedSmoObject.Name.)
Public propertyNotForReplicationGets the Boolean property value that specifies whether the column is participating in replication.
Public propertyNullableGets or sets the Boolean property value that specifies whether the column can accept null values.
Public propertyParentGets the SqlSmoObject object that is the parent of the Column object.
Public propertyPropertiesGets a collection of Property objects that represent the object properties. (Inherited from SqlSmoObject.)
Public propertyRowGuidColGets or sets the Boolean property value that specifies whether the column is automatically updated with a unique GUID value.
Public propertyRuleGets or sets the rule that is bound to the column.
Public propertyRuleSchemaGets or sets the rule schema that is bound to the column.
Public propertyStateGets the state of the referenced object. (Inherited from SmoObjectBase.)
Public propertyStatisticalSemanticsGets or sets a value to indicate whether a column has been enabled for Semantic Extraction and Indexing.
Public propertyUrnGets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Inherited from SqlSmoObject.)
Public propertyUserDataGets or sets user-defined data associated with the referenced object. (Inherited from SmoObjectBase.)
Top
  NameDescription
Public methodAddDefaultConstraint()Adds a default constraint to the column.
Public methodAddDefaultConstraint(String)Adds a default constraint to the column.
Public methodAlterUpdates any Column object property changes on the instance of SQL Server.
Public methodBindDefaultBinds a default to the column.
Public methodBindRuleBinds a rule to the column.
Public methodCreateCreates a column on the instance of Microsoft SQL Server as defined by the Column object.
Public methodDiscoverDiscovers a list of type Object. (Inherited from SqlSmoObject.)
Public methodDropDrops the column.
Public methodEnumForeignKeysEnumerates a list of foreign keys that reference the column.
Public methodEnumIndexesEnumerates a list of indexes that include the column.
Public methodEnumUserPermissionsEnumerates a list of permissions for a specified user.
Public methodEquals (Inherited from Object.)
Protected methodFormatSqlVariantFormats an object as SqlVariant type. (Inherited from SqlSmoObject.)
Protected methodGetContextDBGets the context database that is associated with this object. (Inherited from SqlSmoObject.)
Protected methodGetDBNameGets the database name that is associated with the object. (Inherited from SqlSmoObject.)
Public methodGetHashCode (Inherited from Object.)
Protected methodGetPropValueGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetPropValueOptionalGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetPropValueOptionalAllowNullGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetServerObjectGets the server of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Public methodGetType (Inherited from Object.)
Public methodInitialize()Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Public methodInitialize(Boolean)Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Protected methodIsObjectInitializedVerifies whether the object has been initialized. (Inherited from SqlSmoObject.)
Protected methodIsObjectInSpaceVerifies whether the object is isolated or connected to the instance of SQL Server. (Inherited from SqlSmoObject.)
Public methodMarkForDropMarks the column to be dropped when the Alter method is run on the column's parent Table object.
Public methodRefreshRefreshes the Column object properties. (Overrides ScriptNameObjectBase.Refresh().)
Public methodRenameRenames the column.
Protected methodSetParentImplSets the parent of the SqlSmoObject to the newParent parameter. (Inherited from SqlSmoObject.)
Public methodToStringReturns a String that represents the referenced object. (Inherited from SqlSmoObject.)
Public methodUnbindDefaultUnbinds the currently bound default from the column.
Public methodUnbindRuleUnbinds the currently bound rule from the column.
Public methodUpdateStatistics()Updates Statistic objects that monitor this column.
Public methodUpdateStatistics(StatisticsScanType)Updates Statistic objects that monitor this column.
Public methodUpdateStatistics(StatisticsScanType, Int32)Updates Statistic objects that monitor this column using a sampled scan.
Public methodUpdateStatistics(StatisticsScanType, Int32, Boolean)Updates Statistic objects that monitor this column using a sampled scan.
Public methodValidateValidates the state of an object. (Inherited from SmoObjectBase.)
Top
  NameDescription
Public eventPropertyChangedRepresents the event that occurs when a property is changed. (Inherited from SqlSmoObject.)
Public eventPropertyMetadataChangedRepresents the event that occurs when property metadata changes. (Inherited from SqlSmoObject.)
Top
  NameDescription
Explicit interface implemetationPrivate methodIAlienObject.DiscoverDiscovers any dependencies. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetDomainRootReturns the root of the domain. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetParentGets the parent of this object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetPropertyTypeGets the type of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetPropertyValueGets the value of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetUrnGets the Unified Resource Name (URN) of the object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.ResolveGets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.SetObjectStateSets the object state to the specified SfcObjectState value. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.SetPropertyValueSets the property value. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodISfcPropertyProvider.GetPropertySetGets the interface reference to the set of properties of this object. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate propertyISfcSupportsDesignMode.IsDesignModeGets a Boolean value that specifies whether the column supports design mode.
Top

To get Column object properties, users can be a member of the public fixed server role.

To do any of the following, users must have ALTER permission on the parent table, or be a member of the db_owner fixed database role:

  • Set Column object properties and run the Alter method

  • Create a column

  • Drop a column

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.