0

I have database server with collation: SQL_Latin1_General_CP1_CI_AS

I got database backup file which collation is: Latin1_General_CI_AS

When I'm restoring this database and executing some SQL, I'm getting this error:

Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation

I've changed database collation to match:

ALTER DATABASE database_name
COLLATE SQL_Latin1_General_CP1_CI_AS

And now getting even more this kind of errors.

Is there any common way to modify all database object collation to prevent this kind of issues?

migrated from stackoverflow.com Jan 5 '12 at 18:59

This question came from our site for professional and enthusiast programmers.

2

You have change all user tables and columns individually, droppng and creating all constraints as needed. It's straightforward, just tedious. (SO link)

You can also use COLLATE DATABASE_DEFAULT to coerce collations in code without actually knowing what one is used.

  • In my case I was using stored procedures with temp table declaration. Defining colums added COLLATE DATABASE_DEFAULT and it worked. Thank you – Sergejs Jan 5 '12 at 17:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.