Get startedGet started for free

EXECUTE with return value

Execute dbo.cuspRideSummaryUpdate to change the RideHours to 300 for '3/1/2018'. Store the return code from the stored procedure.

This exercise is part of the course

Writing Functions and Stored Procedures in SQL Server

View Course

Exercise instructions

  • Declare @ReturnStatus as an integer and assign its value to the result of dbo.cuspRideSummaryUpdate.
  • Execute the stored procedure, setting @DateParm to '3/1/2018' and @RideHrs to 300.
  • Select the @ReturnStatus to see its value as well as the '3/1/2018' record from RideSummary to see the impact of the SP update.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

-- Create @ReturnStatus
___ ___ AS int
-- Execute the SP, storing the result in @ReturnStatus
___ ___ = ___.___
    -- Specify @DateParm
	___ = '___',
    -- Specify @RideHrs
	___ = ___

-- Select the columns of interest
___
	@ReturnStatus AS ReturnStatus,
    Date,
    RideHours
FROM ___.___ 
WHERE ___ = '3/1/2018';
Edit and Run Code