ALTER PROCEDURE dbo.ModeratorSpamDeleteComment
DECLARE @CommentID int;
AS
BEGIN
DELETE Comments
WHERE [email protected]
END
它說我有一個不正確的語法附近「AS」和「聲明」 ..問題與存儲過程
我要投放的存儲過程的參數CommentID並執行delete語句..
ALTER PROCEDURE dbo.ModeratorSpamDeleteComment
DECLARE @CommentID int;
AS
BEGIN
DELETE Comments
WHERE [email protected]
END
它說我有一個不正確的語法附近「AS」和「聲明」 ..問題與存儲過程
我要投放的存儲過程的參數CommentID並執行delete語句..
ALTER PROCEDURE
dbo.ModeratorSpamDeleteComment
@CommentID INT
AS
DELETE
FROM Comments
WHERE CommentsID = @CommentID
剛剛擺脫申報:
ALTER PROCEDURE dbo.ModeratorSpamDeleteComment
@CommentID int
AS
BEGIN
DELETE Comments
WHERE [email protected]
END
不要DECLARE
參數;
ALTER PROCEDURE dbo.ModeratorSpamDeleteComment
(--parens are optional but clearer imo
@CommentID int
)
AS --don't need BEGIN/END in this case
DELETE FROM Comments
WHERE [email protected]
移動DECLARE
到你的過程體(BEGIN
和END
之間)。它現在的區域是程序參數。