
To create delete stored procedure, replace the UPDATE statement with DELETE statement and change the parameters accordingly.
CREATE PROCEDURE DeletePersonalDetails -- Add the parameters for the stored procedure here @PersonalDetailsId int AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here DELETE PersonalDetails WHERE PersonalDetailsId = @PersonalDetailsId END
Notice that we have only one parameter in the above stored procedure as we need only that to find out the record having PersonalDetailsId and delete it.
Views: 31033 | Post Order: 91