Solved

Cannot Convert between Unicode and Non Unicode String Data Type

Posted on 2014-07-24
7
364 Views
Last Modified: 2014-07-25
Hello,

In T-SQL script, if I change the following deliveryInstruction by DeliveryInstruction = ''

DeliveryInstruction = replace(replace(replace(replace(substring((select ', ' + ST_NoteText  from Test.DBO.StmNote where ST_Description = 'Import Delivery instructions' and ST_ParentID = JobShipment.JS_PK FOR XML PATH('')), 3, 1000),'
',''),ascii(13),''),ascii(10),''),'&','&'),
The following error is generated :

Cannot Convert between Unicode and Non Unicode String Data Type

Why?

Thanks

Regards
0
Comment
Question by:bibi92
  • 4
  • 2
7 Comments
 
LVL 33

Accepted Solution

by:
ste5an earned 500 total points
ID: 40216761
Please post a concise and complete example. Include table DDL and sample data.

How should we help, when you post a fragment of a statement which is not testable?

The only thing I see, why do you use REPLACE()? Add the unicode string literal marker to all your string literals (N'it'sunicode').
0
 

Author Comment

by:bibi92
ID: 40216919
Hello,

I search how to replace NTEXT column by NULL value.

Thanks

Regards
0
 
LVL 33

Expert Comment

by:ste5an
ID: 40217005
???
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:bibi92
ID: 40217085
Hello,

I try :

I have replaced DeliveryInstruction = '' by  DeliveryInstruction = CAST(N'' AS NVARCHAR(MAX)) ,


Thanks
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 40218446
We are all anxiously waiting for you to tell us what is the question?  I do realize that English may not be your first language, so just a simple query showing the wrong output and the expected output would suffice.
0
 

Author Comment

by:bibi92
ID: 40219866
Ok, I will do it for the next question. I have replaced

DeliveryInstruction = ''
by  
DeliveryInstruction = CAST(N'' AS NVARCHAR(MAX))

and the error Cannot Convert between Unicode and Non Unicode String Data Type is resolved.
0
 

Author Closing Comment

by:bibi92
ID: 40219869
This help to find a solution
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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.

839 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