Compartir a través de


Column Properties

There are two sets of properties for columns, a full set that you can see in the Column Properties tab within Table Designer (available only for Microsoft SQL Server databases) and a subset you can see in the Properties window using Server Explorer.

Note

The properties in this topic are ordered by category rather than alphabet.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Customizing Development Settings in Visual Studio.

Properties Window

These properties appear in the Properties window when you select a column in Server Explorer.

Note

These properties, accessed using Server Explorer, are read-only. To edit column properties for Microsoft SQL Server databases, select the column in Table Designer. Those properties are described later in this topic.

  • Identity Category
    Expands to show the Name and Database properties.

  • Name
    Shows the name of the column.

  • Database
    Shows the name of the data source for the selected column. (Applies only to OLE DB.)

  • Misc Category
    Expands to show the remaining properties.

  • Data Type
    Shows the data type of the selected column.

  • Identity Increment
    Shows the increment that will be added to the Identity Seed for each subsequent row of the identity column. (Applies only to Microsoft SQL Server.)

  • Identity Seed
    Shows the seed value assigned to the first row in the table for the identity column. (Applies only to Microsoft SQL Server.)

  • Is Identity
    Shows whether the selected column is the identity column for the table. (Applies only to Microsoft SQL Server.)

  • Length
    Shows the number of characters allowed for character-based data types.

  • Nullable
    Shows whether or not the column allows null values.

  • Precision
    Shows the maximum number of digits allowed for numeric data types. This property shows 0 for nonnumeric data types.

  • Scale
    Shows the maximum number of digits that can appear to the right of the decimal point for numeric data types. This value must be less than or equal to the precision. This property shows 0 for nonnumeric data types.

Column Properties Tab

To access these properties, in Server Explorer right-click the table to which the column belongs, choose Open Table Definition, and select the row in the table grid in Table Designer.

Note

These properties apply only to Microsoft SQL Server.

  • General Category
    Expands to show Name, Allow Nulls, Data Type, Default Value or Binding, Length, Precision, and Scale.

  • Name
    Displays the name of the column. To edit the name, type in the text box.

    Warning

    If existing queries, views, user-defined functions, stored procedures, or programs refer to the column, the name modification will make these objects invalid.

  • Allow Nulls
    Shows whether or not the column's data type allows null values.

  • Data Type
    Shows the data type for the selected column. To edit this property, click its value, expand the drop-down list, and choose another value.

  • Default Value or Binding
    Shows the default for this column when no value is specified for this column. The drop-down list contains all global defaults defined in the data source. To bind the column to a global default, select from the drop-down list. Alternatively, to create a default constraint for the column, type the default value directly as text.

  • Length
    Shows the number of characters allowed for character-based data types. This property is only available for character-based data types.

  • Precision
    Shows the maximum number of digits allowed for numeric data types. This property shows 0 for nonnumeric data types. This property is only available for numeric data types.

  • Scale
    Shows the maximum number of digits that can appear to the right of the decimal point for numeric data types. This value must be less than or equal to the precision. This property shows 0 for nonnumeric data types. This property is only available for numeric data types.

  • Table Designer Category
    Expands to show the remaining properties.

  • Collation
    Shows the collation setting for the selected column. To change this setting, click Collation and then click the ellipses (…) to the right of the value. (Applies to SQL Server 2000 or later only)

  • Computed Column Specification Category
    Expands to show properties for Formula and Is Persisted. If the column is computed, the formula will also be displayed. To edit the formula, expand this category and edit it in the Formula property.

  • Formula
    Shows the formula that the selected column uses if it is a computed column. In this field you can enter or change a formula.

  • Is Persisted
    Allows you to save the computed column with the data source. A persisted computed column can be indexed.

  • Condensed Data Type
    Displays information about the field's data type, in the same format as the SQL CREATE TABLE statement. For example, a field containing a variable-length string with a maximum length of 20 characters would be represented as "varchar(20)." To change this property, type the value directly.

  • Description
    Shows the description of the column. To see the full description or to edit it, click Description, and then click the ellipses (…) to the right of the property.

  • Full-text Specification Category
    Expands to show properties specific to full-text columns.

  • Is Full-text Indexed
    Indicates whether this column is full-text indexed. This property can be set to Yes only if the data type for this column is full-text searchable and if the table to which this column belongs has a full-text index specified for it. To change this value, click it, expand the drop-down list, and choose a new value.

  • Full-text type column
    Shows which column is used to define the document type of a column of type image. The image data type can be used to store documents ranging from .doc files to xml files. (Applies only to Microsoft SQL Server 2000 or later.)

  • Language
    Indicates the language used to index the column. (Applies only to Microsoft SQL Server 2000 or later.)

  • Has Non-SQL Server Subscriber
    Shows whether the column has a non-Microsoft SQL Server subscriber. (Applies only to SQL Server 2005 and SQL Server 2008.)

  • Identity Specification Category
    Expands to show properties for Is Identity, Identity Increment, and Identity Seed.

  • Is Identity
    Shows whether the selected column is the identity column for the table. To change the property, open the table in Table Designer and edit the properties in the Properties window. This setting applies only to columns with a number-based data type, such as int.

  • Identity Increment
    Shows the increment that will be added to the Identity Seed for each subsequent row. If you leave this cell blank, the value 1 will be assigned by default. To edit this property, type the new value directly.

  • Identity Seed
    Shows the value assigned to the first row in the table. If you leave this cell blank, the value 1 will be assigned by default. To edit this property, type the new value directly.

  • Is Deterministic
    Shows whether the data type of the selected column can be determined with certainty. (Applies only to Microsoft SQL Server 2000 or later.)

  • Is DTS-published
    Shows whether the column is DTS-published. (Applies only to SQL Server 2005 and SQL Server 2008.)

  • Is Indexable
    Shows whether the selected column can be indexed. For example, non-deterministic computed columns cannot be indexed. (Applies only to Microsoft SQL Server 2000 or later.)

  • Is Merge-published
    Shows whether the column is merge-published. (Applies only to SQL Server 2005 and SQL Server 2008.)

  • Is Not For Replication
    Indicates whether original identity values are preserved during replication. To edit this property, click its value, expand the drop-down list, and choose another value.

  • Is Replicated
    Shows whether this column is replicated in another location. (Applies only to SQL Server 2005 and SQL Server 2008.)

  • Is RowGuid
    Indicates whether SQL Server uses the column as a ROWGUID. You can set this value to Yes only for a column with the data type of uniqueidentifier. To edit this property, click its value, expand the drop-down list, and choose another value.

  • Size
    Shows the size in bytes allowed by column's data type. For example, a nchar data type may have a length of 10 (the number of characters) but it would have a size of 20 to account for Unicode character sets.

    Note   The length of a varchar(max) data type varies for each row. sp_help returns (-1) as the length of varchar(max) column. This property displays -1 as the column size for varchar(max) data types.

See Also

Other Resources

Working with Columns

Working with Tables in Table Designer