LOGO

LOGO
LOGO
ads header

Breaking News

MS SQL File Stream UPDATE stream file (Dosyayı güncelleme)

How to Update FILESTREAM Data in SQL Server

To update inserted FILESTREAM data row in a FILESTREAM Table created using the following code:
CREATE TABLE [dbo].[FS_Table]
(
[Id] [int] IDENTITY(1,1) NOT NULL,
[UI] UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL UNIQUE,
[FS_Data] [varbinary](max) FILESTREAM NULL
)
...use this T-SQL command (it will replace an existing image with Id = 1 in the dbo.FS_Table in the FS_Database with the image_001a.jpg file from D:\temp\ folder):
Use FS_Database
GO
UPDATE [dbo].[FS_Table]
SET FS_Data = (SELECT * FROM OPENROWSET(BULK N'D:\temp\image_001a.jpg', SINGLE_BLOB) AS Image001a)
WHERE Id = 1
GO


Hiç yorum yok