Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

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

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.