I have this table that stores an id for each row in sub_id column of type varchar(255), sql server. Other columns store unicode thus those are nvarchar. Now I have this need to update sub_id to nvarchar for SOME reason. I ran following command:
ALTER TABLE TABLE_NAME ALTER COLUMN SUB_ID NVARCHAR(255)
This changed the column type but set the length to 510. I do not want to change length of the column. If I must mention, table has a lot of data and length of sub_id never exceeds 20.
I read about this and could not figure out how to truncate the column in length.
Following is snapshot from sp_help on mentioned table (subject_id is sub_id)