SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Implicit Conversion Varchar to Char in SELECT
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

besadmin
Posting Yak Master

116 Posts

Posted - 05/26/2010 :  17:01:21  Show Profile  Reply with Quote
Hi,

I am just trying to do a simple select, with some subselect and join, but I am getting this silly error message:

"Msg 457, Level 16, State 1, Line 1
Implicit conversion of varchar value to char cannot be performed because the collation of the value is unresolved due to a collation conflict."

If someone could help me out with this I would greatly appreciate it.

Let me know if you need anymore info.

Thanks soo much in advance!!


	Select DISTINCT
		  Shipment_Number as fcOrderID
		, (SELECT source_order_no FROM Server1.db1.dbo.pick_list_hdr  
				WHERE pick_list_no = '123456789') as p21OrderNo
		, Carrier_Name as Carrier
		, Ship_Date as dateShipped
		, CASE --Tracking Number
			When Tracking_Number IS NOT NULL Then
				Tracking_Number 
			When Tracking_Number IS NULL Then
				(SELECT d.pro_nbr 
				FROM db2..delivery_arc d 
				JOIN db2..deliveryorders_arc do ON d.delivery_nbr = do.delivery_nbr 
				WHERE do.order_id = '123456789') 
		  END AS PROTrackingNo
	FROM Server1.db3.dbo.BES_PackageTrackingDetails
	WHERE shipment_number = '123456789'

webfred
Flowing Fount of Yak Knowledge

Germany
8760 Posts

Posted - 05/27/2010 :  01:54:20  Show Profile  Visit webfred's Homepage  Reply with Quote
Examine db2..delivery_arc and db2..deliveryorders_arc in SSMS via right click.
Do they have different collations?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

besadmin
Posting Yak Master

116 Posts

Posted - 05/27/2010 :  15:01:39  Show Profile  Reply with Quote
Thanks for the reply!
I fixed it by adding COLLATE to the end of this line like so;

WHERE do.order_id COLLATE Latin1_General_CI_AS = @Search
Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8760 Posts

Posted - 05/27/2010 :  15:57:36  Show Profile  Visit webfred's Homepage  Reply with Quote
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000