SQL Server - is there a way to mass resolve collation conflicts

后端 未结 3 1909
温柔的废话
温柔的废话 2021-01-06 18:48

We have a situation where the collation of databases, tables, and some columns are different between our dev and production SQL Servers, and it\'s wreaking havoc on developm

3条回答
  •  不知归路
    2021-01-06 19:41

    Generally, use "COLLATE DATABASE_DEFAULT" on temp table, table variables etc

    Collation conflicts usually happen you have server vs database collation conflicts, server in this case being tempdb.

    Frankly, I would make an effort to align your collations and have them all one per database.

    If you have mix and match across servers, databases and columns then there is no magic bullet. You could start by looking for all COLLATE clauses in code (see above) followed by ensuring all columns have collation removed....

提交回复
热议问题