?
Solved

unicode and non-unicode string

Posted on 2008-10-17
6
Medium Priority
?
1,069 Views
Last Modified: 2013-11-10
cannot convert between unicode and non-unicode string.  The custdesc in sql table is ntext and casted as nvarchar(1000) in sql cmmand that pulls info into excel.   I have changed the excel  create table sql to
custdesc nvarchar(1000)  ,custdesc ntext null .  it does not seem to be working..any inputs?
0
Comment
Question by:ohemaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 400 total points
ID: 22745673
Not sure what EXACTLY what you're doing, but it seems like you are trying to export data from SQL 2005 to excel?

Well for starters you should be using nvarchar(max) instead of ntext in your SQL 2005 tables.

text and ntext and scheduled to be removed in future versions: http://msdn.microsoft.com/en-us/library/ms187993(SQL.90).aspx

Perhaps you could create a view that casts your ntext to nvarchar(max).

create view vw_Customer
as
select cust.name, cast(cust.custdesc as nvarchar(max)) as custdesc
from customer cust
GO

Then try using the view as your source.
0
 
LVL 17

Accepted Solution

by:
HoggZilla earned 1600 total points
ID: 22745691
Using the Advanced Edit, check the column datatypes for both SQL and Excel. Even if you CAST in the Source SQL it might be confused? Also, SSIS is very sensitive about nvarchar and varchar (unicode and non-unicode). It also hates NTEXT, there are some other workarounds.
Post your SQL Source and the Create Table for your Excel Destination for more input.
0
 

Author Comment

by:ohemaa
ID: 22758622
Checking Advanced Editor inputs outputs pro.

SQl inputs
Name      CustomerInfo
Datatype  String[Dt_str]
Length     (1000)

Excel outputs

Name      CustomerInfo
Datatype  String[Dt_str]
Length    (1000)
 but I still get customerinfo cannot convert between unicode and non unicode string data types
0
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 
LVL 17

Assisted Solution

by:HoggZilla
HoggZilla earned 1600 total points
ID: 22759269
There is another simple route you can try. Create a new package using the wizard allowing SSIS to create the Excel Destination table.
You could also try changing the database datatypes from nvarchar to varchar.
0
 

Author Comment

by:ohemaa
ID: 22780337
solution from google.  add data conversion and convert customerinfo to unicode
0
 
LVL 17

Expert Comment

by:HoggZilla
ID: 22780702
OK, a Data Conversion task could work but I am not sure why you are selecting a column from SQL with NTEXT and it becomes a DT_STRING? If the column in SQL is NTEXT and you select it asis, it will come into SSIS as "Unicode text stream [DT_NTEXT]"
Since Excel only understands 6 datatypes from SSIS, see below, and DT_NTEXT is one of them, you should not be getting a unicode coversion error.
SSIS to Excel Datatypes:
Numeric  double-precision float (DT_R8)
Currency  currency (DT_CY)
Boolean  Boolean (DT_BOOL)
Date/time  date (DT_DATE)
String  Unicode string, length 255 (DT_WSTR)
Memo  Unicode text stream (DT_NTEXT)
 
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question