Sunday

howto put file into varbinary (OPENROWSET,BULK,SINGLE_BLOB) on MS SQLServer


CREATE TABLE [cmp].[tblCMPEmailAttachements](
[AttachmentID] [int] IDENTITY(1,1) NOT NULL,
[EmailID] [int] NOT NULL,
[FileName] [nvarchar](50) NULL,
[CreatedDate] [datetime] NULL,
[FileBody] [varbinary](max) NULL
) ON [PRIMARY]



Declare @attID int
Insert into cmp.tblCMPEmailAttachements (EmailID,FileName,CreatedDate) values (1,'1.gif',GETDATE())
SET @attID = SCOPE_IDENTITY();
update cmp.tblCMPEmailAttachements set
[FileBody] = (SELECT * FROM OPENROWSET(BULK 'C:\1.gif', SINGLE_BLOB)AS [FileBody] ) WHERE AttachmentID=@attID

more...

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...