question archive  stored procedure called [deleteAuthor]

 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.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

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;