|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Changing table column size
I'm new to mssql.
I need to change the size of a column of a table from char(255) to char(500). I used the line: alter table table_name alter column column_name char(500) When I run that command, I get a message that it was sucessful. However, when I try to enter data into the changed column, the number of characters I can enter is still 255. I check the information schema for the column and the 'character_maximum_length' field is 500. What is the problem here? Is the maximum allowable length for char 255? How can I get a column to have 500 characters? |
|
#2
|
|||
|
|||
|
What enterprise Manager says when you edit the table properties?
255 or 500? your sql statement seems fine...but go check with Enteprise Manager. |
|
#3
|
|||
|
|||
|
xiphias, when you alter a columns size wich is of type char and for example you change from 20 to 30,
and you have in it 15 charcters, after the change it will be filled with another 15 space characters to complete 30. this is the way with char so try or to change it to varchar wich is better or if you trim the string inside or if you edit it directly, go to the end with the 'End' key and delete the spaces wich complete the string. Please reply if that helps, i got the same error you got, i solved it by changing to varchar but didnt try to solve it keeping the char type. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Changing table column size |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|