SQLServerCentral.com / T-SQL (SS2K5) / SQL Server 2005 / how to insert image into a column / Latest PostsInstantForum.NET v99.99.99SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comFri, 09 Dec 2016 08:58:31 GMT20RE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxHello,Thanks for your post. So - you have the file on the network share and a pointer in the database, but what mechanism in an application controls how the object is accessed? Is there a goto statement or something? Where can I find instructions on this?Thanks.Wed, 28 Apr 2010 16:46:52 GMTKenena KlossonRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxHi,i have tried this but i am getting following error:Cannot bulk load because the file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\etwcnf.xml" could not be opened. Operating system error code 3(The system cannot find the path specified.).Thu, 25 Feb 2010 01:50:02 GMTvasanti mestriRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxHi!I have an image to insert form a URL path.I tried to substitute the name of the file, in your example, with the URL "http:\\....." but it is not working.Could you have any suggestions to help me ?Thanks,AntonioWed, 24 Feb 2010 04:44:01 GMTcamino.aprilRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxJust in case....the SQL 2000 utility was TextCopy.exeI am trying to insert a wav file as an image which I could do with TextCopy.exe and a stored proc in 2000 but I haven't found a way in 2005 yet.Tue, 15 Jul 2008 13:09:05 GMTdobiefriendlyRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspx<P>Simalar issue:</P><P>Having unloaded a table (containing column "Contents long binary") from a Sybase SQLAny db, I am now trying to bulk insert the data into a SS2K5 db table with the same schema ("Contents" data type is now "<FONT color=#0000ff size=2>varbinary</FONT><FONT color=#808080 size=2>(</FONT><FONT color=#ff00ff size=2>max</FONT><FONT color=#808080 size=2>)").</FONT></P><P><FONT color=#808080>Here's the SQL:</FONT></P><FONT color=#0000ff size=2><P>BULK</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>INSERT</FONT><FONT size=2> DocumentBinaries </FONT><FONT color=#0000ff size=2>from</FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2>'C:\TW\KMCA\Scripts\SQL Server\Data\DocumentBinaries_Export.DAT'</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>WITH</FONT><FONT size=2> </FONT><FONT color=#808080 size=2>(</FONT><FONT size=2> KEEPIDENTITY </FONT><FONT color=#808080 size=2>,</FONT><FONT size=2> FIELDTERMINATOR </FONT><FONT color=#808080 size=2>=</FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2>'\t'</FONT><FONT size=2> </FONT><FONT color=#808080 size=2>,</FONT><FONT size=2> ROWTERMINATOR </FONT><FONT color=#808080 size=2>=</FONT><FONT color=#ff0000 size=2>'<br>'</FONT><FONT color=#808080 size=2>,</FONT><FONT size=2> MAXERRORS </FONT><FONT color=#808080 size=2>=</FONT><FONT size=2> 100 </FONT><FONT color=#808080 size=2>)</FONT><FONT size=2> </FONT><FONT color=#808080 size=2>;</FONT></P><P><FONT color=#808080 size=2><FONT color=#000000>DocumentBinaries is the only table with an Image/varbinary column in a group of over 300 being migrated, and the only tbale I can get the above statement to work for.</FONT></P></FONT><P><FONT color=#808080 size=2>The following errors result:</FONT></P><FONT color=#808080 size=2><FONT size=1><P>Msg 4864, Level 16, State 3, Line 1</P><P>Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 2 (contents).</P><P>Msg 7399, Level 16, State 1, Line 1</P><P>The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.</P><P>Msg 7330, Level 16, State 2, Line 1</P><P>Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".</P></FONT></FONT>Fri, 27 Jul 2007 15:09:00 GMTTakaumaRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxand there you go... Have to love the simple alternatives. <img src='images/emotions/tongue.gif' height='20' width='20' border='0' title='Tongue' align='absmiddle'>Thu, 05 Jul 2007 12:10:00 GMTCrispin ProctorRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxthank you so much Bledu!Thu, 05 Jul 2007 11:25:00 GMTbugRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxNice!Wed, 04 Jul 2007 08:26:00 GMTSwePesoRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspx<PRE>CREATE TABLE myTable(Document varbinary(max))GO</PRE><PRE>INSERT INTO myTable(Document) SELECT * FROM OPENROWSET(BULK N'C:\Image1.jpg', SINGLE_BLOB) AS Document </PRE><PRE>GO</PRE>Tue, 03 Jul 2007 16:48:00 GMTbleduRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxI prefer to store files on the filesystem, and just the location of the file in sql server.Mon, 02 Jul 2007 18:06:00 GMTjezemineRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxThank you, I will try SSIS...Mon, 02 Jul 2007 10:00:00 GMTbugRE: how to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspxSSMS does not ahve any way to do it. You could use SSIS or as you said, an app.There was a little tool shipped with SQL 2000 which did it but I cannot for the life of me remember what it is called. Will look tonight on home machine.Mon, 02 Jul 2007 09:54:00 GMTCrispin Proctorhow to insert image into a columnhttp://www.sqlservercentral.com/Forums/Topic378279-338-1.aspx<P>Hi,</P><P>How can I insert an image into a table directly? I see this is usually done through application. but I just want to know if it is possible to directly do something like this-</P><P>insert into table1 (imgcol) values (somethingbuthow)</P><P>Your reply will be highly appreciated.</P><P> </P><P> </P>Mon, 02 Jul 2007 09:47:00 GMTbug