SQL2005: INSERT Images/Pictures FROM a FOLDER to my Table/Field with Data type Image

  • Hi,

     

    Any suggestion, how I Insert pictures/images from my Windows XP folder to my SQL Server 2005 table/field with data type image?

     

     

    INSERT INTO [MyDataBase].[dbo].[Table1Images]

               ([Field1]

               ,[Description])

         VALUES

               (<Field1, image,>

               ,<Description, char(35),&gt

     

    FROM MyFolder\My pictures\Images

     

     

    Or I could move my pictures from my folder to some place the SQL can read the pictures. I have tried to move the pictures into an Excel sheet without luck. All the fields from the excel sheet goes into the table, except the pictures.??? Of course, The Murphy's Law.

     

    Thank you,

    Rune

  • This was removed by the editor as SPAM

  • There are different ways you can do this. Here is a link that tells you how to do this (note that this requires some client side code): http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316887. In SQL Server 2005, you can also use the OPENROWSET function which has been enhanced to support loading images. Here is an article that explains it: http://www.trigonblue.com/Text_Market/Load_Image_to_SQL_Server_2005.htm.

    HTH,

    Srinivas Sampath

    HTH,
    Srinivas Sampath
    Blog: http://blogs.sqlxml.org/srinivassampath

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

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