使用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



posted @ 2009-12-27 23:16  ok_008  阅读(1789)  评论(0编辑  收藏  举报
给我写信