ALTER DATABASE a SET TRUSTWORTHY ON;
drop table db_table
go
create table db_table
(bin_execfile varbinary (max)
, app_name varchar(100)
, var_name varchar(100)
)
insert into db_table (app_name, var_name) values ('wms', 'ver')
go
Update DB_Table set bin_execfile = (SELECT * FROM OPENROWSET(BULK '\\10.0.0.101\temp\test.txt', SINGLE_BLOB) upd_file) where app_name='WMS' and var_name='VER'
go
Update DB_Table set bin_execfile = (SELECT * FROM OPENROWSET(BULK 'c:\windows\system32\drivers\etc\hosts', SINGLE_BLOB) upd_file) where app_name='WMS' and var_name='VER'
go
select * from db_table