首页 > 数据库

如何利用存储过程插入更新IMAGE数据类型

时间:2009-05-05 17:50:53  作者:P.J.CHEN  我要投稿
Linux初探欢迎您的投稿,投放方法请点击这里查看,我们会定期赠送精美小礼品给优秀的投稿作者。海纳百川 取则行远!LinuxGoo欢迎您的到来。
数据库表对于字段IMAGE数据类型如何进行插入或者更新。对于插入比较简单可以用INSERT语句CREATE PROCEDURE uf_chw_cpflInfoInsert -- Add the parameters for the......

数据库表对于字段IMAGE数据类型如何进行插入或者更新。

对于插入比较简单可以用INSERT语句

CREATE PROCEDURE uf_chw_cpflInfoInsert
-- Add the parameters for the stored procedure here
@flLevel as MyVarchar50,
@lbMc as MyVarchar50,
@lbXh as MyVarchar50,
@flZjm as MyVarchar50,
@lbTx as MyImage
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
INSERT INTO [chw_cpflInfo]
([flLevel]
,[lbMc]
,[lbXh]
,[flZjm]
,[lbTx])
VALUES
(@flLevel,@lbMc,@lbXh,@flZjm,@lbTx)

END

更新:

CREATE PROCEDURE uf_chw_cpflInfoUpdate
-- Add the parameters for the stored procedure here

@lbBh as MyIdentity,
@flLevel as MyVarchar50,
@lbMc as MyVarchar50,
@lbXh as MyInt,
@flzjm as MyVarchar50,
@lbTx as MyImage

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
update chw_cpflinfo
set fllevel=@fllevel,
lbmc=@lbMc,
lbXh=@lbXh,
flzjm=@flZjm,
lbTx=@lbTx
where lbbh=@lbbh
EXEC sp_dboption 'chemicalweb', 'select into/bulkcopy', 'true'

-- 当为 true 时,允许使用 SELECT INTO 语句和快速大容量复制。

DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(lbtx) from chw_cpflinfo where lbbh=@lbbh
--UPDATETEXT chw_cpflinfo.lbtx @ptrval null null @lbTx
WRITETEXT chw_cpflinfo.lbtx @ptrval @lbTx
EXEC sp_dboption 'chemicalweb', 'select into/bulkcopy', 'false'


END

如果您需转载 如何利用存储过程插入更新IMAGE数据类型,请注明来自LinuxGoo.com,其版权归原作者所有。请广大网友留言时遵纪守法,使用文明用语。如果您在应用中有什么问题,请在下面留言,我们会尽快解答。
来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
栏目热门