0
select (Civilimg1 + Civilimg2) as civilimagefull 
from NewCus

but I get an error:

Msg 8117, Level 16, State 1, Line 2
Operand data type image is invalid for add operator.

How can I solve this problem?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
afis ni
  • 21
  • 4
  • `image` is type of binary data...?? if Yes you can't – Dgan Nov 16 '14 at 16:45
  • 3
    What are you trying to do, *adding* two binary blobs?? – marc_s Nov 16 '14 at 16:45
  • You could cast them as varchar, but what are you trying to achieve? – Sparky Nov 16 '14 at 16:46
  • http://stackoverflow.com/questions/22919259/multiple-rows-into-a-single-row-and-combine-column-sql this could help you a bit. but i think you'll have to change the data type – Koushik Roy Nov 16 '14 at 16:48
  • @Sparky - Explicit conversion from `data type image` to `varchar` is not allowed. – Pரதீப் Nov 16 '14 at 16:54
  • 2
    `ntext`, `text`, and `image` data types will be removed in a future version of SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use `nvarchar(max)`, `varchar(max)`, and `varbinary(max)` instead. [See details here](http://msdn.microsoft.com/en-us/library/ms187993.aspx) – marc_s Nov 16 '14 at 17:02
  • You cant do this, yes you could for returning, but binary doesnt work this way. – Trevor Nov 16 '14 at 17:08
  • 1
    What kind of data do these columns contain? – Olivier Jacot-Descombes Nov 16 '14 at 17:10

1 Answers1

0

As mentioned by Mark_S I dono what are you trying to do here by adding to image columns but still if you want to do then cast the image column as Binary then you can concatenate the two columns together. Try this.

select  cast(Civilimg1  as varbinary(max))+cast(Civilimg2 as varbinary(max)) 
from    NewCus
Pரதீப்
  • 91,748
  • 19
  • 131
  • 172