We have TestPartner database in SQL Server. The descriptions of the bugs are stored in \"image\" datatype column. We need to write a query to display the data as html table. We
My guess would be that the data stored in your image column is not 'normal' text - I would guess that it's some arbitrary data structure (hence the decision to use image rather than varchar) ?
I tried this without a problem:
declare @data varchar(max)
declare @fred table (d1 varchar(max), d2 xml, d3 image)
set @data = 'here is some data'
while (len(@data) < 200) set @data = @data + ' ' + cast(rand() as varchar)
insert into @fred (d1,d2,d3) values (@data,@data,@data)
set @data = 'here is some more data'
while (len(@data) < 200) set @data = @data + ' ' + cast(rand() as varchar)
insert into @fred (d1,d2,d3) values (@data,@data,@data)
declare @xml xml
set @xml = (select cast(cast(d3 as varbinary(max)) as varchar(max)) as 'td' from @fred FOR XML PATH('tr'), TYPE)
select @xml