I have a database that I'm accessing via SQL Management Studio 2014 (SMS2014). There is a field
use the below script..
UPDATE Yourtable SET Signature = BulkColumn from Openrowset( Bulk 'C:\Images\image.PNG', Single_Blob) as UserImage WHERE userID=@userID --mention the user ID
If you wanted to loop through the images.try something like below. Append the user id's of your User table with the image name (like image1,image2) and so taht we can easily identify which image belongs to which user..
DECLARE @imgString varchar(80) DECLARE @insertString varchar(3000) SET @count = 1 WHILE @count< 101 --total count of images BEGIN SET @imgString = 'C:\images\Image' + CONVERT(varchar,@count) + '.png' SET @insertString = N'UPDATE User SET Signature= BulkColumn FROM OPENROWSET(BULK N''' + @imgString + ''', SINGLE_BLOB) as UserImage where userID = @count' EXEC(@insertString) SET @count = @count + 1 END GO