This is a discussion on Any easy way to change column length like varchar 30 to varchar 100? within the SQL Server forums, part of the Microsoft SQL Server category; --> I would like to increase the length of the column from LOCNumber VARCHAR(30) DEFAULT '' to LOCNumber VARCHAR(100) DEFAULT ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I would like to increase the length of the column from LOCNumber VARCHAR(30) DEFAULT '' to LOCNumber VARCHAR(100) DEFAULT '' without losing any data currently stored in the field. And it has an index on it defined as CREATE INDEX LOCIndex ON BookData(LOCNumber) Thanks for any help. |
| |||
| On 31 Jan 2005 07:05:21 -0800, sdowney717@msn.com wrote: > >I would like to increase the length of the column from >LOCNumber VARCHAR(30) DEFAULT '' > >to >LOCNumber VARCHAR(100) DEFAULT '' > >without losing any data currently stored in the field. Hi sdowney, Just use ALTER TABLE: ALTER TABLE BookData ALTER COLUMN LOCIndex varchar(100) No need to re-specify the default - it won't be changed. Best, Hugo -- (Remove _NO_ and _SPAM_ to get my e-mail address) |
| Thread Tools | |
| Display Modes | |
|
|