错误:整理冲突 [英] Error : Collation Conflict

查看:96
本文介绍了错误:整理冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部

当我执行querry时,它显示错误

将varchar值隐式转换为varchar不能执行是因为由于排序规则冲突而导致值的排序规则未解决。

这是我的SQL Querry

Hi, All
When i execute a querry,its showing an error
Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.
Here is my SQL Querry

 SELECT    Points AS Point_Issue_Points, Points AS Receipt_Points,'' AS Issue_Points, '' AS Point_Issue_InvoiceNo, ''  AS Point_Issue_Amount, Points.Point_Date AS Point_Issue_Date,'' AS Branch_ID,'' AS Merchant_ID, (SELECT        Merchant_Name
	                                FROM            Merchant_Details
	                                WHERE        (Merchant_ID = @Merchant_ID)) AS Merchant_Name,'Associate' AS Card_Holder_Name,'Receipt' AS Type
	   INTO              [#Temp1]
	   FROM            Points 
	   WHERE        (Points.Merchant_ID = @Merchant_ID) AND (@SearchType <> 'Issued')
	 --  SELECT * FROM #Temp1
	 SELECT    Point_Issue_Points, (CASE WHEN Point_Issue_Points<0 THEN (Point_Issue_Points * -1) ELSE '' END)AS Receipt_Points,(CASE WHEN Point_Issue_Points>0 THEN Point_Issue_Points ELSE '' END)  AS Issue_Points,Point_Issue.Point_Issue_InvoiceNo, Point_Issue.Point_Issue_Amount, Point_Issue.Point_Issue_Date, Point_Issue.Branch_ID, 
	                          Point_Issue.Merchant_ID,
	                              (SELECT        Merchant_Name
	                                FROM            Merchant_Details
	                                WHERE        (Merchant_ID = @Merchant_ID)) AS Merchant_Name, Card_Holder_Details.Card_Holder_Name,(CASE WHEN Point_Issue_Points<0 THEN 'Receipt' ELSE 'Issue' END) AS Type
	 INTO              [#Temp2]
	 FROM            Point_Issue LEFT OUTER JOIN
	                          Card_Holder_Details ON Point_Issue.Point_Issue_CardNo = Card_Holder_Details.Card_Unique_No
	 WHERE        (Point_Issue.Merchant_ID = @Merchant_ID) AND (@SearchType <> 'Receipt')
SELECT * FROM #Temp1 UNION ALL  SELECT * FROM #Temp2



有谁知道为什么它会发生,它在localhost中完美运行,但不在我的托管服务器上运行。


Can anyone know why it occurs, Its running perfectly in the localhost, but not on my hosted server.

推荐答案

由于整理而你收到此错误...

了解有关排序规则的更多信息,请参阅: Technet-Collat​​ions [ ^ ]& 整理 [ ^ ]

You are getting this error because of Collations...
to know more about the collations see:Technet-Collations[^] & Collations[^]
Quote:

您可以使用CREATE TABLE或ALTER TABLE语句的COLLATE子句为每个字符串列指定排序规则。您还可以在使用SQL Server Management Studio创建表时指定排序规则。如果您没有指定排序规则,则会为该列分配数据库的默认排序规则。

You can specify collations for each character string column using the COLLATE clause of the CREATE TABLE or ALTER TABLE statement. You can also specify a collation when you create a table using SQL Server Management Studio. If you do not specify a collation, the column is assigned the default collation of the database.



所以我建议您检查在此查询中使用的表的排序规则,如果使用任何临时表,指定临时表的排序规则....


so i suggest you to check the collations of the tables you are using in this query, if using any temp tables, specify the collation for the temp table....


这篇关于错误:整理冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆