changing data type in userdef tabletype

for changing type in table, it is easy:
alter table table1 alter column column1 smallint not null
but it is not straight forward in user defined table type..
(CREATE TYPE abc AS TABLE(column list)

right now to change the data type in the column list within the table type, we have to drop the defined data type and add it back.. if there are any dependencies, they need to be dropped also..

if you have any suggestions to simplify this, when you have to change a type, please share.

thanks
LVL 5
25112Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Please explain why dropping and re-creating the user-defined table type would cause a problem.   Chances are this may not be a good programming practice.
0
25112Author Commented:
jimhorn, when you have to change for many such instances across the database and there are many code objects dependent, so you have to first drop the functions and then drop the table types, then readd the function and then the table types..  so much to just change a data type :(
0
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Yeah that could be pretty involved, and I'm guessing that there is a high potential for failure if objects dependant on a table that is defined as a type, and has it's column changed, causes downstream problems.

I don't have an immediate answer for you other than I'm not seeing any support docs that spell out how to alter a column in a data type, ergo 'You can't do that'.

So ... I'll back away from the question to encourage other experts to respond.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.