Click here to Skip to main content
15,889,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
SQL
 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

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

1 solution

You are getting this error because of Collations...
to know more about the collations see:Technet-Collations[^] & Collations[^]
Quote:
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....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900