concatenate image with varchar

  • Hi Friends,

    I want to concatenate image column with varchar column in stuff function. is it possible?

    Thanks,

    Abhas.

  • is the image datatype actually a text file or something stuffed into the column? what is in the image column? a real image? html rtf or something?

    if the base type is not text of some kind, you simply cannot do what you are asking.

    you'd convert to varbinary, then varchar(max), then fiddle with the text.

    select convert(varchar(max),Convert(varbinary(max),MyImageColumn)) From SomeTable

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thannks Lowell

    Actually i want to display as test + Checkbox+ test1 +checkbox +test2.

    here i have stored checkbox as image in the database. I am displaying as test , test1, test2 but i want to display checkbox instead of comma(,). Is it possible?

    Thanks

    Abhas.

  • well, this has more to do with the display medium more than anything. if you mean checkbox is actually code like this:

    <img src="Mywebsite.checkbox.gif">

    or

    <input type="checkbox" >

    or your image is actually a binary value like 0x0000A38C00BEB787....

    are you constructing HTML that will then be rendered?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • yes, Iamge is binary value like 0x0000A38C00BEB787....

    Thanks,

    Abhas

  • abhas (2/24/2015)


    yes, Iamge is binary value like 0x0000A38C00BEB787....

    Thanks,

    Abhas

    then no, you cannot do what you are asking.

    you cannot concatenate an image to text.

    you might be able to display text and image side by side in html, but that's adifferent animal.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanx Lowell,

    By the way any other option to do this? i need to display output as test1(checkbox)test2(checkbox). Client want just output,i can use any other methos as well.

    Thanks

    Abhas.

  • abhas (2/24/2015)


    Thanx Lowell,

    By the way any other option to do this? i need to display output as test1(checkbox)test2(checkbox). Client want just output,i can use any other methos as well.

    Thanks

    Abhas.

    it 100% depends on what medium this is displayed in: pdf, word, html , wpf, windows forms,etc.

    without knowing that, it's all guess work.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Hi Lowell,

    I will use this in crystal report which will display in pdf format.

    Thanks

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply