Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Removing User Defined data types

Author  Topic 

the1gadget
Yak Posting Veteran

55 Posts

Posted - 2005-09-19 : 04:34:21

Hi All

I have a number of user defined data types that are simple Varchar’s of different lengths in a large number of tables.

I want to change them back to there original data types in all the tables.

What is the easiest way ?

I was thinking of delving into the meta data and changing it there. (but not sure where it will be)

--
David

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-19 : 04:53:30
Do you want to use Varchar datatype and dont want to use User defined datatype?
Then run this (Before running these take a backup of that database)

Select 'Alter Table '+Table_Name+' Alter Column '+Column_Name+' varchar(100)' from Information_Schema.columns
where Data_type='yourDataType' order by Table_Name

Copy the result back to Query Analyser and run them which you want to change

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

the1gadget
Yak Posting Veteran

55 Posts

Posted - 2005-09-19 : 05:31:36
Thanks Madhivanan

Almost what I need. For some reason the Data_type does not show the datatype but the info is there in Domain_{Catalogue|Name|Schema}

Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-19 : 05:57:45
>>For some reason the Data_type does not show the datatype
Did your replace yourDataType by the actual User defined Data type name in that query?
What is the problem you are facing now?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -