Recently in the database, involving the insertion of images, but 2008 is no longer supporting textcopy, need to use the OPENROWSET. In fact, the individual thinks this is better. The following example copy from Elsewhere
UPDATE and OPENROWSET can used together toImportAn image into a table. OPENROWSET can used toImportA file into a single row, and single column value. OPENROWSET (BULK' data_file ',| Single_blob | Single_clob | SINGLE_NCLOB) Parameter descriptiondata_file the name and path of the file to read. Single_blob | Designate the Single_blob Object forImporting into a varbinary (max) Datasingle_clob | Type, Single_clob forASCII data into a varchar (max) data type, Andsingle_nclob Single_nclob forimporting into a nvarchar (max) UNICODE data type. Referenced From:sql Server 2005 T-SQL Recipes A problem-solution approach20>21>22> CREATE TABLE imagetable (23> ; IdintNot null,24> Gif varbinary (max) not null25>) 26> go1>2>INSERTImagetable3> (ID, Gif) 4> SELECT 1,5> bulkcolumn6> from OPENROWSET (BULK' C:\yourImage.gif ', Single_blob) as x7> go1>2> SELECT gif3> from imagetable4> WHERE ID = 15> go1>2>UPDATEImagetable3> SET Gif =4> (SELECT bulkcolumn5> from OPENROWSET (bulk6>' C:\newImage.gif ',7> Single_blob) as x 8> WHERE ID =19> go1>2> drop table imagetable3> GO
How to insert picture data into SQL SERVER 2008