To insert a image from filesystem to a Microsoft SQL Server 2008 database with a TSQL query, use:

INSERT INTO MyTable(MyImageColumn)
SELECT * FROM
OPENROWSET(BULK N'C:\Image1.jpg', SINGLE_BLOB)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.