Change Data Type

  • There is a function or Store Procedure that let change the data-type defined for user for other.

    For Example:

    USER_ID = CHAR (20)

    Change USER_ID to CHAR(15) with out use

    - sp_droptype or sp_addtype sp

    Because this could afect all the Dependants Tables.

    Thanks

  • What do you want to do exactly?? and why?

  • Really we  Before define some domains.

    One of this domains defined is USER_ID = Char(20)

    All the tables in the database was created using this data type.

    But actually we need to change this Domain USER_ID = Char(30) because we need fit more data into each field.

  • That can't really cause problems... why aren't you just altering the tables?

    Also why aren't you using varchar()?

  • User defined data-types are not ALTERABLE!! to accomplish what you want you need to create a new type, alter those columns using the old type to use the new and then drop the old type

    In my opinion the use of userdefined data-types have more cons than pros and I tend to avoid them!!

    Cheers

     


    * Noel

  • There are a lot of table actually defined with this data type.

    Alter table could not have efects because we are changing all the domain not only one expecific field into one database.

     

  • Sorry I hadn't understood the user defined datatype part. As Noeld said, you have to unlink the UDD, drop it, recreate it and then rebind it the the columns. I'd do without the last part though.

  • Carlos scripting the change is maybe the only way around and is not very complicated. There is not such thing as sp_altertype

     


    * Noel

  • As Noeld says there is no any store procedure that lets yo make a modifcation into a user-defined data type and should to be tru a Store procedure created.

     

    Thank you all for your help.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply