I have a table at the moment with columns ( id#(int), picture(varbinary(MAX) ), and I have a folder on my HDD with a ton of pictures. The pictures in the folder are named by the ‘id’ I want to match them with in my table. How can I do this?
Example:
Table Row: id=25166, picture=NULL
25166.jpg
If you need an example which uses just SQL checkout the following:
It uses a cursor to loop through each of the rows which do not contain image data and for each row found uses the OPENROWSET BULK provider to load the file.