Sql 用Insert插入二进制

CREATE PROCEDURE addImage
(
@bin image,
@ID varchar(50)
)
AS
DECLARE @ptrval binary(16)

UPDATE Smart_Config SET D_LogoImage = '' WHERE D_GUID=@ID
--IF DATALENGTH(@bin)<4096
--SET @bin = SUBSTRING(@bin, 1, DATALENGTH(@bin)-1)
SELECT @ptrval = TEXTPTR(D_LogoImage) FROM Smart_Config WHERE D_GUID = @ID
UPDATETEXT Smart_Config.D_LogoImage @ptrval null NULL @bin

posted on 2008-08-27 17:45  永无止境  阅读(917)  评论(0编辑  收藏  举报