다음을 통해 공유


How to: Modify Column Length

When you select a data type, the column length is automatically defined. You can reset the Length property for a column with a character data type, such as binary, char, nchar, nvarchar, varbinary, or varchar, if you want to increase or decrease the length of acceptable values in that column. For columns with numeric data types, the length is set by the Precision property.

Note

A new version of Table Designer appears for databases in the SQL Server 2012 format. This topic describes the old version of Table Designer, which you use with databases in earlier formats of SQL Server.

In the new version, you can change a table definition through a graphical interface or directly in a script pane. If you use the graphical interface, the table’s definition is automatically updated in the script pane. To apply the SQL code in the script pane, choose the Update button. For more information about the new version, see How to: Create Database Objects Using Table Designer.

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.

To modify the length of a columns data type

  1. In Server Explorer, right-click the table with columns for which you want to change the length and click Open Table Definition.

    The table opens in Table Designer.

  2. In the Column Properties tab, type a length for the column's data type in the Length field.

Note

You can edit the Length property for character data types only.

The new length is assigned to the column in the Table Designer after you click outside the grid cell or use the TAB key to move to another grid cell. It takes effect in the database when you save your changes in Table Designer.

See Also

Reference

Column Properties

Other Resources

Working with Columns