Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

Cannot Convert between Unicode and Non Unicode String Data Type

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
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bibi92

ASKER

Hello,

I search how to replace NTEXT column by NULL value.

Thanks

Regards
???
Avatar of bibi92

ASKER

Hello,

I try :

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


Thanks
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.
Avatar of bibi92

ASKER

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.
Avatar of bibi92

ASKER

This help to find a solution