Collation Problem in migration

  • Hi,

    I just migrated a SQL65 server with a collation(Sort order 30 on bin-CP437)  to a SQL2K server with default collation (Sort oder 52 on CP 1252). Now I got a problem in a View with Select Distinct statement. in SQL2K. It bascially gives different result as shown in SQL65. Could you some give me some ideas as to how to fix it? 

     

    Thanks

     

    John

     

     

  • This is the way to change collation in a query.

    Note that you can also change it in the table definition, but that would obviously change every query that touches the field(s) with modified collation.

    Select count(distinct name collate Latin1_General_CS_AS) from dbo.ObjSQL --case and accent sensitive

    --count = 3435

    Select count(distinct name collate Latin1_General_CI_AI) from dbo.ObjSQL --case and accent IN - sensitive

    --count = 3336

    Select count(distinct name collate Latin1_General_CS_AI) from dbo.ObjSQL --case sensitive and accent IN - sensitive

    --count = 3425

    Select count(distinct name collate Latin1_General_CI_AS) from dbo.ObjSQL --case IN - sensitive and accent sensitive

    --count = 3348

  • I got it. Thanks a lot!!

  • HTH. Did you change the collation only in the query or in the table DDL?

  • In query.

    Thanks

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

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