错误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 展开
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 展开
展开全部
你根本就没有错误, 只是在每个存储过程之间 要有一个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
--其中你的 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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询