|
Home > Archive > MS SQL Server > February 2006 > alter user defined data type length
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
alter user defined data type length
|
|
| Vikram 2006-02-07, 7:23 am |
| I have one UDD, which is used in some tables.
Now i want to change its length. How can i do that ?
| |
|
| The only way i know of is to drop it and re-create it...
sp_droptype
sp_addtype
but you can't drop a type if it's being referenced by any columns
The way to go would be this:
EXEC sp_rename UDName, old_UDName
EXEC sp_addtype UDName, 'varchar(20)'
ALTER TABLE tbl1 ALTER COLUMN col1 UDName
ALTER TABLE tbl2 ALTER COLUMN col2 UDName
--
HTH. Ryan
"Vikram" <aa@aa> wrote in message
news:e7qkGn9KGHA.2012@TK2MSFTNGP14.phx.gbl...
>I have one UDD, which is used in some tables.
> Now i want to change its length. How can i do that ?
>
>
|
|
|
|
|