Solved

unicode and non-unicode string

Posted on 2008-10-17
6
1,002 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
  • 3
  • 2
6 Comments
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 17

Assisted Solution

by:HoggZilla
HoggZilla earned 400 total points
Comment Utility
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
Comment Utility
solution from google.  add data conversion and convert customerinfo to unicode
0
 
LVL 17

Expert Comment

by:HoggZilla
Comment Utility
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now