.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

can not convert between unicode and non unicode string data types

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :Sql Server

Hi All, i am simply transferring data from excel to sql and i have data conversion task in middle with string data type set to all fields but still its giving me the error : can not convert between unicode and non unicode string data types

Any idea?

View Complete Post

More Related Resource Links

Column Name - cannot convert between unicode & nonunicode string data types



Im using the OLEDB Source to connect the source columns. But its throwing an error msg Column Name - cannot convert between unicode & nonunicode string data types. Could you please provide me the oracle code so that I can use with the select statement. For some of the schemas I have chaged the data types using the derived column before the OLEDB destination.

Actually, one of my team member suggested me to use the Oracle char(2) in the select statement. Can any one help me with the code so that I can use it for the rest of the columns.

Eg source(External Column) - CreatedBYID - DT_wstr(18)

Source - Output cloumn - CreatedById - DTStr(18)



OLE DB Source & Destination -cannot convert between unicode and non-unicode string data types


Requesting all  for a solution for this problem.

My Package Components:

  1. OLE DB SOURCE - Connected to Oracle 11g server using Oracle Provider for OLEDB.
  4. OLE DB DESTINATION - Connected to SQL server 2008 R2 -Windows 2008R2 64 bit.
Oracle Source Table:

  [MST_ID] NUMBER(2340089,1) NOT NULL,
  [USER_ID] [varchar2](40) NULL,
  [INS_DT] date NULL,
  [SAVED_FLG_TYPE] [varchar2](20) NULL

SQL Server DestinationTable:

  [MST_ID] [int] IDENTITY(2340089,1) NOT NULL,
  [USER_ID] [varchar](40) NULL,
  [TMP_XML] [varchar](max) NULL,
  [TMP_EDT_FLG] [int] NULL,
  [INS_DT] [datetime2](7) NULL,
  [PAT_ID] [int] NULL,
  [SAVED_FLG_TYPE] [varchar](20) NULL

Error: cannot convert between unicode and non-unicode string data types


How do I set a string in a textbox to unicode?

I have a report requirement to embed the fonts when the report is exported to PDF. The report server is  SSRS 2005 SP3 and upgrading to SSRS2008 is not an option. I have validated that all requirements have been met to ensure embedding have been met except one -  "The characters in the string that has the Font property set are Unicode, not ANSI. No font embedding occurs for ANSI characters." I referenced this article for requirements -  http://technet.microsoft.com/en-us/library/ms159713.aspx . My data is in a dataset field that was populated by a stored procedure. When I examine the rdl the it has a type name of System.String (<rd:TypeName>System.String</rd:TypeName>) How can I ensure that any strings in the report are recognized as unicode? The SSRS PDF renderer must be interpreting the strings as ANSI because that's how they are being rendered in the PDF file preventing embedding. Any assistance would be greatly appreciated!

Convert Database ANSI To UNICODE

Hi Friends, I Have DB in 2008 And Now i want That table to convert To SQL 2000. So Can anybody tel how we can convert Data from ANSI to UNICODE and vice a versa. Thanks . 

I don't see unicode data in .vcf file in c# .net

Hi ,   I developed the application in c# that create & write a Vcard file using StreamWriter or BinaryWriter but i open vcf file the name field cannot display the unicode characters correctly..   For example This  "Gabriele Tögl" display as "Gabriele T?gl"   I tried encoding UTF8 & UTF7,UTF32 but it fails.

cannot convert between unicode and non-unicode


I keep getting the error message below when attempting to import a text file (flat file) to an SQL Server Destination using SSIS. This database has recently been migrated from SQL Server 2000 (where I used a DTS Package that worked fine). I plan on doing further manipulation to the file after importing but have so far tried to keep one step at a time. I have tried using a smaller files and different tables but still get a similar response. I believe that the encoding of the text file is ANSI. If it is relevant the database collation is Latin1_General_CI_AS (the same as it was when 2000). Any help anyone can provide will be greatly appreciated!!!

TITLE: Package Validation Error

Package Validation Error


Error at Data Flow Task [SQL Server Destination [174]]: Columns "Column 0" and "AccountNumber" cannot convert between unicode and non-unicode string data types.

Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 1" can't be inserted because the conversion between types DT_STR and DT_I4 is not supported.

Error at Data Flow Task [SQL Server Destination [174]]: The column "Column 2" can't be inserted because the

Unicode data insertion in MySql



I am trying to insert Unicode data  in a table of MySql which I have set for UTF-8 general ci. The problem is when I insert the row into the table using Asp.net application. It shows ???? instead. If I copy the string from the debug mode and paste that in Mysql. it also shows the same problem.

But when I type the insert command in Mysql Query Browser and put each fields value individually in insert statement, it works. 

Can someome solve that problem. what Asp.net formats extra so that it shows ????

Thanks & best Regards

Jay Khatri

cannot convert a text to unicode




Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

Date and Time Data Types and Functions

The following sections in this topic provide an overview of all Transact-SQL date and time data types and functions. For information and examples that are common to date and time data types and functions

Frequently Asked Questions - SQL Server Data Types

This is good and precise introduction and Frequently Asked Questions - SQL Server Data Types

extract picture data from a string


dears,advance thanks.can anybdy help to solve my problem which is describing below.

Example- %%D1,100,0,0004[data...][0d0a]

Head - %%D1
Amount of data package -100
The data package No. - 0
Data Length -1024 (0004 (low bit in front, high bit in back) 0004= 0x0400=1024;)

data- Original Picture data -1024(maximum)
Tail -0x0d0a
Data in hex

from the above example i want to extract picture data and need to store in to the sql table.sql table columname is image and datatype is also image.after that i wanted to display this image column to an aspx page.

expecting help asap.

How to save Unicode in SQL Server 2005

I am using google transliteration to display the text in Hindi/Tamil

I tried to store the text appear as Hindi from textarea in an nvarchar
field of database (SQL Server 2005) , the text saved as "???????".

After retireving text from the same it display the text as "???????".

Can anyone help me how to store and retrieve the actual data from SQL
Server 2005?

I am using ASP.net,VB.Net and SQL Server 2005

convert SQL data to EDI 835 file


I was assigned to create a app to convert SQL data to EDI 835 file. (Electronic Data Interchange file for Health Care Claim Payment/Advice,  outbound process only).

Can someone help me where to start?

Worldly Windows: Extend The Global Reach Of Your Applications With Unicode 5.0


When using global applications, people want to communicate with others on their terms, in their own languages. Unicode 5.0 brings that ideal closer to reality.

Julie D. Allen, Michael S. Kaplan, Cathy Wissink

MSDN Magazine January 2007

MSLU: Develop Unicode Applications for Windows 9x Platforms with the Microsoft Layer for Unicode


The Microsoft Layer for Unicode (MSLU) provides Unicode support on Windows platforms that don't provide their own support, including Windows 98, Windows 95, and Windows Me. With MSLU you can write Unicode applications easily for these platforms. MSLU is simple to install, small (even though it wraps more than 400 APIs), and easy on system resources. This article explains the design criteria behind MSLU and how to put the layer to work for you.

Michael Kaplan and Cathy Wissink

MSDN Magazine October 2001

Failed to convert parameter value from a String to a Guid.


I am trying to get the UserRole from the logged in user and send it to the database table my code is:

SqlParameter FamilyFriendsOther = new SqlParameter("@Role", SqlDbType.UniqueIdentifier);
        string [] roles = System.Web.Security.Roles.GetRolesForUser();
        if (roles.Length > 0)
            FamilyFriendsOther.Value = roles[0];

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend