I have table like this
CREATE TABLE [dbo].[Product](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](100) NOT NULL,
[Description] [nvarchar](max) NOT NULL,
[Price] [decimal](16, 3) NOT NULL,
[SmallPhoto] [varbinary](max) NULL);
I want load image into [SmallPhoto] field
Main script looks like this
declare @filePath varchar(max)
declare @productId int
set @filePath = 'D:\myfile.png'
set @productId = 1
update Product
set SmallPhoto = -- some actions
where Id = @productId
Expected result
Command(s) completed successfully. :)
UPD:
1) My database located in other machine
2) I do not have opportunity to copy file to remote machine