Database Collation

  • Please help me solve this error.

    I'm trying to change the default collation of the database from Latin1_General_BIN to SQL_Latin1_General_CP1_CI_AS.

    [font="Courier New"]Msg 1505, Level 16, State 1, Line 5

    The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'sys.sysschobjs' and the index name 'nc1'. The duplicate key value is (0, 1, PK_TABLE1).

    Msg 5072, Level 16, State 1, Line 5

    ALTER DATABASE failed. The default collation of database 'TIOS' cannot be set to SQL_Latin1_General_CP1_CI_AS.[/font]

  • As mentioned in the error there are issue with the said index drop the index and recreate it later after changing the collation.

    If you are getting multiple this kind of errors than you can create the table with desire collation and import the data.

    HTH

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • The problem is I can't find where the said index.

  • Found my answer by finding the conflict index using

    SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME LIKE '%PK_TABLE1%'

    and removed the key then change the collation of the database.

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

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