当前位置: 代码迷 >> Sql Server >> 高手求救 就急 !
  详细解决方案

高手求救 就急 !

热度:34   发布时间:2016-04-27 17:52:55.0
高手求救 就急 在线等!!!!
各位帮小弟个忙   帮我看看下面这个关于Leaveword表的存储过程有什么问题   谢谢好心人

CREATE   PROCEDURE   Pr_GetLeaveword
AS
SELECT*
FROM   Leaveword
ORDER   BY   CreateTime   DESC

CREATE   PROCEDURE   Pr_GetSingleLeaveword
(
@LeavewordID   int
)
AS
SELECT   Leaveword.*
FROM   Leaveword
WHERE   [email protected]

CREATE   PROCEDURE   Pr_AddLeaveword
(
@Title   varchar(100),
  @Body   varchar(200)=NULL
)
AS
INSERT   INTO
Leaveword(Title,Body,CreatTime)
VALUES   (@Title,@Body,GetDate())
RETURN   @@Identity

CREATE   PROCEDURE   dbo.Pr_DeleteLeaveword
(
@LeavewordID   int
)
AS
DELETE   Leaveword
WHERE   [email protected]


------解决方案--------------------
CREATE PROCEDURE Pr_AddLeaveword
(
@Title varchar(100),
@Body varchar(200)=NULL,
@id int output
)
AS
INSERT INTO
Leaveword(Title,Body,CreatTime)
VALUES (@Title,@Body,GetDate())
SET @id = @@Identity
return @id
------解决方案--------------------
CREATE PROCEDURE Pr_GetLeaveword
AS
SELECT *
FROM Leaveword
ORDER BY CreateTime DESC
  相关解决方案