SQL Server SQL Cannot resolve the collation conflict between "Arabic_100_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation

fquxozlt  于 2023-11-16  发布在  其他
关注(0)|答案(3)|浏览(97)

When i clicked right on my DB , this error appears "SQL Cannot resolve the collation conflict between "Arabic_100_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation. Could not use view or function 'dbo.sysdac_instances' because of binding error"


I don't know to change the collation

UPDATE I tried this code to change default collation of DB But it gives an error

Update2

Please help me to solve this issue.

Thanks in advance.

guz6ccqo

guz6ccqo1#

Your two tables are using different collation. You can tell your query to use a specific collation like this:

SELECT * FROM A JOIN B ON A.Text = B.Text COLLATE SQL_Latin1_General_CP1_CI_AS

Or if you prefer to use the database default collation:

SELECT * FROM A JOIN B ON A.Text = B.Text COLLATE DATABASE_DEFAULT

Updated

I think you need to set the database to single user mode

use master
ALTER DATABASE yourDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE    
ALTER DATABASE yourDB MODIFY NAME = [yourDBNew]
ALTER DATABASE yourDBNew SET MULTI_USER
oknrviil

oknrviil2#

Try below syntax :

SELECT * FROM Table1 PT
  JOIN Table2 TA ON PT.Value COLLATE DATABASE_DEFAULT = TA.Value COLLATE DATABASE_DEFAULT
fwzugrvs

fwzugrvs3#

My issue was resolved this way, as two queries from different databases were joining.

相关问题