How can i change collation of userdefined datatype?

  •  

    Hi everyone?

    How can i change collation of userdefined datatype?

    When i try to change it Management Studio Query

    varcharUzun = varchar(100) --> userdefined data type....

    ALTER TABLE tbxxxx ALTER COLUMN sDefinition varcharUzun COLLATE Turkish_CI_AS NOT NULL

    when i run the query it says.

    Msg 452, Level 16, State 1, Line 2

    COLLATE clause cannot be used on user-defined data types.

    i also cannot ALTER the userdefinedtypes collation itself. And i canyt chance the collation if the column is PrimaryKey []

    Is there any other to change the collation without dropping and re-creating the objects.

    Thanks.

  • You cannot change the collation of a UDT. It inherits from the database collation.

    You could still include the collation in your select statement if that is what you want to achieve.


    Everything you can imagine is real.

  • You may have remove UDT and use native data types...

    Use alter table statement to accomplish this...Make sure you handle temp table created in tempdb because tempdb get the collation from the model/server...

     

    MohammedU
    Microsoft SQL Server MVP

Viewing 3 posts - 1 through 2 (of 2 total)

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