Solved

unicode and non-unicode string

Posted on 2008-10-17
6
1,057 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 100 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 400 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Assisted Solution

by:HoggZilla
HoggZilla earned 400 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

717 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