Columns "Month" and "F1" cannot convert between unicode and non-unicode string data types

I have a view in SQL Server 2005 database and I am trying to export the view by using sql server export wizard. When I get to the last step of the wizard, in "Validating" part I get an error: Columns "Month" and "F1" cannot convert between unicode and non-unicode string data types.

What is causing it and how can I fix the issue?
LVL 35
YZlatAsked:
Who is Participating?
 
lokaboyConnect With a Mentor Commented:
Instead of exporting a view, you could import it from the receiving application(Excel/Access). You could also try to create a view from the table and use the CONVERT function to change the data format of these columns.
0
 
Om PrakashCommented:
Please check the following KB article:
http://www.mssqltips.com/tip.asp?tip=1393
0
 
YZlatAuthor Commented:
om_prakash_p, I am sorry but that particular article is not really relevant
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Om PrakashCommented:
Are you exporting data to CSV/Excel file?

If you are importing the data from CSv/Excel file or exporting data, Change the data types of columns for which you are getting error.
0
 
YZlatAuthor Commented:
I can export to csv. Ity's Excel format that I am having trouble with. And there are no options to chnage column data type through the wizard
0
 
YZlatAuthor Commented:
thanks lokaboy, i will try using CONVERT
0
 
YZlatAuthor Commented:
btw, which data type should I convert varchar to?
0
 
YZlatAuthor Commented:
lokaboy, what worked for me is modifying the view using CAST:


SELECT CAST(Month As Varchar(50)) as Month,
CAST (Field1 as Varchar(100)) As Field1
FROM table1

I had to do that even though originally fields were varchar(50, varchar(100) respectively.
0
 
lokaboyCommented:
Nice, Excel has a lot of issues when importing from SQL. Importing queries in excel does not always use the same syntax as in SQL. Hopefully this is betetr in Office 2007.
Glad you got it working :-)
0
 
YZlatAuthor Commented:
used CAST instead of CONVERT but it was close
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.