我已经编写了更新存储过程,这里是代码
CREATE PROCEDURE writer_update_art
@articleid int
@title nvarchar(50) ,
@subject text ,
@tag nvarchar(25),
AS
update articles
set (title = @title, subject = @subject, tag = @tag)
where articleid = @articleid
RETURN
但出现错误:
'@ title'附近的语法不正确
附近的语法不正确
'('
答案 0 :(得分:3)
您不需要SET
语法的括号,而且您的逗号错位:
CREATE PROCEDURE writer_update_art
@articleid int,
@title nvarchar(50),
@subject text,
@tag nvarchar(25)
AS
update articles set title = @title , subject=@subject , tag=@tag
where articleid=@articleid
RETURN
答案 1 :(得分:2)
在param列表的末尾不需要内部括号或额外的逗号(在列表中的第一个param之后需要逗号):
CREATE PROCEDURE writer_update_art
(
@articleid int,
@title nvarchar(50) ,
@subject text ,
@tag nvarchar(25)
)
AS
update articles
set title = @title,
subject = @subject,
tag = @tag
where articleid = @articleid
RETURN