错误156:在关键字create附近有语法错误 必须声明变量@LeavewordID

必须声明变量@TitleSQL2000存储过程代码如下:CREATEPROCEDUREPr_GetLeavewordsASSELECT*FROMLeavewordsORD... 必须声明变量 @Title
SQL 2000 存储过程代码如下:
CREATE PROCEDURE Pr_GetLeavewords
AS
SELECT*
FROM Leavewords
ORDER BY Create Time DESC
CREATE PROCEDURE Pr_GetSingleLeaveword
(
@LeavewordID int
)
AS
SELECT Leavewords.*
FROM Leavewords
WHERE LeavewordID=@LeavewordID
CREATE PROCEDURE Pr_AddLeaveword
(
@Title varchar(100),@Body varchar(2000)=NULL
)
AS
INSERT INTO
Leavewords(Title,Body,GeateTime)
VALUES(@Title,@Body,GetDate())
RETURN @@Identity
CREATE PROCEDURE Pr_DeleteLeaveword
(
@LeavewordID int
)
AS
DELETE Leavewords
WHERE LeavewordID=@LeavewordID
展开
 我来答
dailong555
2010-05-18 · TA获得超过128个赞
知道答主
回答量:103
采纳率:0%
帮助的人:98.2万
展开全部
你根本就没有错误, 只是在每个存储过程之间 要有一个GO 来执行下一句

--其中你的 Create Time 中有create关键字 是不是CreateTime
CREATE PROCEDURE Pr_GetLeavewords
AS
SELECT*
FROM Leavewords
ORDER BY CreateTime DESC
go
CREATE PROCEDURE Pr_GetSingleLeaveword
(
@LeavewordID int
)
AS
SELECT Leavewords.*
FROM Leavewords
WHERE LeavewordID=@LeavewordID

go
CREATE PROCEDURE Pr_AddLeaveword
(
@Title varchar(100),@Body varchar(2000)=NULL
)
AS
INSERT INTO
Leavewords(Title,Body,GeateTime)
VALUES(@Title,@Body,GetDate())
RETURN @@Identity

go
CREATE PROCEDURE Pr_DeleteLeaveword
(
@LeavewordID int
)
AS
DELETE Leavewords
WHERE LeavewordID=@LeavewordID
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式