Use SP to UPDATE
Create a stored procedure named cuspRideSummaryUpdate in the dbo schema that will update an existing record in the RideSummary table.
Diese Übung ist Teil des Kurses
Writing Functions and Stored Procedures in SQL Server
Anleitung zur Übung
- The SP should accept input parameters for each
RideSummarycolumn and be named@Dateand@RideHrs. - Make
@Dateparameter adatedata type and@RideHrsanumericdata type. - Use
UPDATEandSETkeywords to assign the parameter values to theRideSummaryrecord where the@Datematches theDatevalue.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
-- 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;