Question: The code below contains errors. Can you please correct the errors so that the procedure can execute successfully. ALTER PROCEDURE dbo.AddSale @employeeid INT, @productid INT,

The code below contains errors. Can you please correct the errors so that the procedure can execute successfully.

ALTER PROCEDURE dbo.AddSale @employeeid INT,

@productid INT,

@quantity SMALLINT,

@saleid UNIQUEIDENTIFIER OUTPUT

AS

SET @saleid = NEWID

TRY

INSERT Sales.Sales

@saleid,

@productid,

@employeeid,

@quantity

TRY

CATCH

INSERT INTO dbo.DB_Errors

(SUSER_SNAME(),

ERROR_NUMBER(),

ERROR_STATE(),

ERROR_SEVERITY(),

ERROR_LINE(),

ERROR_PROCEDURE(),

ERROR_MESSAGE(),

GETDATE());

CATCH

GO

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!