IniziaInizia gratis

Use SP to UPDATE

Create a stored procedure named cuspRideSummaryUpdate in the dbo schema that will update an existing record in the RideSummary table.

Questo esercizio fa parte del corso

Writing Functions and Stored Procedures in SQL Server

Visualizza il corso

Istruzioni dell'esercizio

  • The SP should accept input parameters for each RideSummary column and be named @Date and @RideHrs.
  • Make @Date parameter a date data type and @RideHrs a numeric data type.
  • Use UPDATE and SET keywords to assign the parameter values to the RideSummary record where the @Date matches the Date value.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

-- Create the stored procedure
___ ___ ___.___
	-- Specify @Date input parameter
	(___ ___,
     -- Specify @RideHrs input parameter
     ___ numeric(18,0))
AS
BEGIN
SET NOCOUNT ON
-- Update RideSummary
___ ___
-- Set
___
	___ = @Date,
    ___ = @RideHrs
-- Include records where Date equals @Date
___ ___ = ___
END;
Modifica ed esegui il codice