使用SQL语句直接保存图片

 use Test
go
If object_id('Picture'Is Not Null
    
Drop Table Picture
Go
Create Table Picture
(
    FileName 
nvarchar(255),
    ExternalFile 
varbinary(max)
)
Go

Insert into Picture(FileName , ExternalFile)
Select 'PitureName', BulkColumn FROM OPENROWSET(
Bulk N'G:\test.jpg', SINGLE_BLOB) As a
Go



原文地址:https://www.cnblogs.com/wghao/p/1633672.html