a blog for those who code

Thursday 6 December 2018

How to Solve varbinary is incompatible with text

I was working on SQL Server and while inserting some texts, it started throwing error varbinary is incompatible with text. We usually get a lot of incompatible error like below :


  • operand type clash date is incompatible with int
  • operand type clash text is incompatible with tinyint
  • operand type clash float is incompatible with date
  • date is incompatible with tinyint
  • operand type clash xml is incompatible with int
  • operand type clash int is incompatible with intlist


What does these messages means is what you are trying to insert is not able to handled by the type of the column. For example in my case 'varbinary is incompatible with text', that means I am trying to insert varbinary which is incompatible to my column which is of type text.

To solve this we need to convert the input to VARCHAR() and then insert it into the table. In my case it was a null value and the column with datatype text does not recognize null values, after converting it to varchar, it sends it as a blank text.

Please like and share the CodingDefined.com blog if you find it useful and helpful.

No comments:

Post a Comment