how to insert images in to image table

  • how to insert images in to image table through query

    i created one table like..

    CREATE TABLE [dbo].[image](

    [image2] [varbinary](50) NULL,

    [id] [int] NULL

    )

    GO

    i don't know how to insert/retrieve images through query...

    Please give some example query..

    in my system

    MS SQL SERVER 2008 Enterprise Edition.....

    Thanks in advance....

    [font="Verdana"]SRIHARI(:~[/font]

  • Try this

    insert into image (image2,id)

    select Bulkcolumn from openrowset (bulk 'path of image file', single_blob) as picture,1

  • Hi,

    My 2c...

    1. I am concerned that varbinary(50) may not be sufficient storage space.

    2. Depending on usage, you may want to check out FILESTREAM if you are using sql server 2008.

    I cannot verify syntax.

    Good luck!

Viewing 3 posts - 1 through 2 (of 2 total)

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