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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

lokaboyCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.