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

前端之家收集整理的这篇文章主要介绍了查询分析器报错 怎么改存储过程?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

问题:

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

猜你在找的MsSQL相关文章