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.
| Author |
Topic |
|
the1gadget
Yak Posting Veteran
55 Posts |
Posted - 2005-09-19 : 04:34:21
|
| Hi AllI 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.columnswhere Data_type='yourDataType' order by Table_Name Copy the result back to Query Analyser and run them which you want to changeMadhivananFailing to plan is Planning to fail |
 |
|
|
the1gadget
Yak Posting Veteran
55 Posts |
Posted - 2005-09-19 : 05:31:36
|
| Thanks MadhivananAlmost 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 |
 |
|
|
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?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|