remove column collation

  • Hi all,

    We have noticed on a test server the "Fatal error 644" problem, and after

    some searching, found: http://support.microsoft.com/kb/822747

    Which pretty much pointed us to the problem. After doing a DBCC DBREINDEX on

    the specifc problem table, the inital instance of the problem has been

    resolved.

    In addition, it was determined that the specif problem existed due to an

    explicit collation specified on a column that is indexed. this should not be

    there (legacy).

    Now, obviously I can drop and recreate the table correctly (collation of

    columns are not a problem in terms of the data, so we wouldn't have data loss

    concerns). What I am trying to find out is whether I could do an ALTER TABLE

    to remove an explicit collation. Reviewing BOL I believe I can add one, but

    how do I remove one?

    ALTER TABLE tb

    ALTER COLUMN x COLLATION default

    ^-- syntax doesn't work - is there a correct way?

    Thoughts, better solutions?

  • Hi,

    The following should work

    ALTER TABLE Test_tbl ALTER COLUMN Name

                varchar(50) COLLATE Latin1_General_CI_AS NOT NULL

     


    Helen
    --------------------------------
    Are you a born again. He is Jehova Jirah unto me

  • Thanks for the response Helen

    I am trying to find out whether it is possible to do this and pick up the defaulty collation for the database, as opposed to explicitly specifying the collation... I.e. so way to alter it to go from an explicit collation like "Latin1_General_CI_AS " to a database default, which may be "SQL_Latin1_General_CI_AS" etc.

  • Hi,

    ALTER TABLE Test_tbl ALTER COLUMN Name

                varchar(50) NOT NULL

    will take the default collation

     


    Helen
    --------------------------------
    Are you a born again. He is Jehova Jirah unto me

  • Will test and try - thanks!

Viewing 5 posts - 1 through 4 (of 4 total)

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