I created few user defined types in DB as below
CREATE TYPE [dbo].[StringID] FROM [nvarchar](20) NOT NULL
and assigned to various tables. My tables in db are in various schemas (not only dbo)
But I realized I need bigger field, and I need to alter, e.g increase from nvarchar to nvarchar, but there is no ALTER TYPE statement
I need a script that temp table/ cursor whatever and save there all tables and fields where my type is used. Then change existing fields to base type - e.g. from CustID [StringID] to CustID [nvarchar(20)]. Drop the user type and recreate it with new type - e.g. nvarchar(50) and finally set back fields to user type
I do not have rules define on types, so don't have to drop rules and re-add them
I'm not very familiar with T-Sql, so any help is appreciated.