question archive stored procedure called [deleteAuthor]
Subject:Computer SciencePrice:9.82 Bought3
stored procedure called [deleteAuthor]. It will DELETE the [author] record with the [authorId] that is passed in as a parameter of @authorId.
CREATE PROCEDURE deleteAuthor (@authorId INT)
AS
DELETE FROM author
WHERE ID=authorId
GO;
or
CREATE PROCEDURE deleteAuthor (@authorId INT)
AS BEGIN
DELETE FROM author
WHERE ID=authorId
END;
Step-by-step explanation
Syntax of stored procedure
CREATE PROCEDURE procedure_name
AS
sql_statement
GO;
CREATE PROCEDURE deleteAuthor (@authorId INT)
AS
DELETE FROM author
WHERE ID=authorId
GO;