Solved

Cannot Convert between Unicode and Non Unicode String Data Type

Posted on 2014-07-24
7
368 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
[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
  • 4
  • 2
7 Comments
 
LVL 34

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 34

Expert Comment

by:ste5an
ID: 40217005
???
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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

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.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

688 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