One Star

Implicit conversion from data type nvarchar to varbinary is not allowe

Hi All,
I am doing an ETL job to transfer from 1 data source to another, but unfortunately few of the column datatype is in Object. As I try to run the job, I got this error:
"Implicit conversion from data type nvarchar to varbinary is not allowed. Use the CONVERT function to run this query"
Can I know how to solve this issue to get rid from this error or how to use the convert function? I have try to read those thread who face the same problem like me but it does not work.
Thanks in advance =)
Mohd Fuzaimi
6 REPLIES
One Star

Re: Implicit conversion from data type nvarchar to varbinary is not allowe

Hi Mohd Fuzaimi
Which database do you use?
This issue is caused by wrong data type.
Maybe you choose a wrong column type by mistake.
Because i don't know details of your schemas, i can't figure out the wrong point.
Could you show me?
Best regards!
Pedro
One Star

Re: Implicit conversion from data type nvarchar to varbinary is not allowe

I have this error:
Disallowed implicit conversion from data type nvarchar to data type money. Use the CONVERT function to run this query.
I need insert values to a database
One Star

Re: Implicit conversion from data type nvarchar to varbinary is not allowe

Use the CONVERT function?
One Star

Re: Implicit conversion from data type nvarchar to varbinary is not allowe

I don't understand what it mean?
One Star

Re: Implicit conversion from data type nvarchar to varbinary is not allowe

Somebody resolved this error?
Seven Stars

Re: Implicit conversion from data type nvarchar to varbinary is not allowe

It comes down to :

 You cannot perform this conversion using an ALTER TABLE statement since converting from varchar(max) to varbinary(max) requires an explicit conversion.


So you should follow these steps to alter your table:

  1. Alter table with new column of VARBINARY(MAX)
  2. If you have existing data in the VARCHAR(MAX) column, use update statement to add the data to the VARBINARY column
  3. Alter table to drop the VARCHAR(MAX) column
  4. Rename varbinary column to varchar name. 

Sorry... it's DB limitation which makes sence due to the datatype in which it is stored.