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)
 Casting Text to Varchar

Author  Topic 

jtrirogoff
Starting Member

4 Posts

Posted - 2007-05-02 : 18:52:36
I'm trying to cast a text field to a varchar but I get the following error:

'Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.'

This is the part that's causing my query to fail:
(CASE WHEN <textfield> IS NULL THEN 'NULL' ELSE CAST(<textfield> AS varchar(5000)) END)

What's weird is that when I run this query on an SQL Server 2000 instance it works, it fails with the above error when I try to run it on an instance of SQL Server 2005.

Any ideas guys???

- Jonny

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-03 : 00:26:23
Do you have different collations at table level and database level?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -