sql server: alias data type

i have this code
CREATE TYPE ShortDescription
FROM nvarchar(10) NOT NULL ;

create table miTabla
(id int identity,
 observacion ShortDescription)

MyTable table has 10,000 rows.
  I need to change shortDescription to nvarchar (12), as I can do?
enrique_aeoAsked:
Who is Participating?
 
sarabhaiConnect With a Mentor Commented:
The only way to alter a User Defined Data Type is to create a new User Define Data Type (UDDT), and change out all existing column to that UDDT, then you can drop the original one, and recreate it and change out the change you made previously.  The problem is that you can't drop the UDDT if it is in use.
0
 
Alpesh PatelAssistant ConsultantCommented:
Alter Table TableName
Alter column modify Columnsname DataType
0
 
enrique_aeoAuthor Commented:
I change the column observacion , but it uses an alias data type, as I can modify the alias data type?
0
 
Raja Jegan RConnect With a Mentor SQL Server DBA & ArchitectCommented:
>> but it uses an alias data type, as I can modify the alias data type?

You can't modify a data type as it is not available per Design.
Instead the options available for you are

1. DROP TYPE and then CREATE TYPE back. But this will impact all existing tables with those types
2. ALTER TABLE to change datatype of that column to Varchar(12)

ALTER TABLE miTabla ALTER COLUMN observacion varchar(12);
0
All Courses

From novice to tech pro — start learning today.