Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Implicit Conversion Varchar to Char in SELECT

Author  Topic 

besadmin
Posting Yak Master

116 Posts

Posted - 2010-05-26 : 17:01:21
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
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-27 : 01:54:20
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 - 2010-05-27 : 15:01:39
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
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-27 : 15:57:36
welcome


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

- Advertisement -