SQL Server Performance

Export an Image or PDF file in Remote Sql Server Database Table and/or Remote Server Folder from Local machine without using Front-end Applications

Discussion in 'SQL Server 2005 General DBA Questions' started by bsethi24, Jan 23, 2011.

  1. bsethi24 New Member

    Dear All,
    Hi ! I need a MS-SQL QUERY based solution to Export an Image or PDF file into Remote SQL Server Database table from local machine.
    For example: -
    I have an Image file on my local drive named "Text.jpg" & I have to export it in "Image" column of Table named "ImageData" exists on Remote Server (for example: - on 84.14.14.14). I have full access on this server via SQL Management studio.
    Kindly guide me.
  2. satya Moderator

    As referred in BOL here is the sample TSQL:
    CREATE TABLE ImageTable(PIC varbinary(max))
    INSERT INTO ImageTable(Document)
    SELECT * FROM
    OPENROWSET(BULK N'%path:ImageFile.jpg', SINGLE_BLOB)

Share This Page