加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

查询分析器报错 怎么改存储过程?

发布时间:2020-12-12 12:33:52 所属栏目:MsSql教程 来源:网络整理
导读:问题: Create proc UpdateImage ( @id bigint, @UpdateImage Image ) As Insert Into employerInfo(Picture) values(@UpdateImage) where ID=@id GO 查询分析器报错 服务器: 消息 156,级别 15,状态 1,过程 UpdateImage,行 8 在关键字 'where' 附近有语

问题:

Create proc UpdateImage
(
@id bigint,
@UpdateImage Image
)
As
Insert Into employerInfo(Picture) values(@UpdateImage)
where ID=@id
GO


查询分析器报错
服务器: 消息 156,级别 15,状态 1,过程 UpdateImage,行 8
在关键字 'where' 附近有语法错误。

答:

insert 插入不需要where

你是修改数据吧
Create proc UpdateImage
(
@id bigint,
@UpdateImage Image
)
As
update employerInfo set Picture = @UpdateImage
where ID=@id
GO

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读