EXEC scalar
You created the SumRideHrsSingleDay function earlier in this chapter. Execute that function using the EXEC keyword and store the result in a local variable.
Diese Übung ist Teil des Kurses
<Kurs>Writing Functions and Stored Procedures in SQL Server</Kurs>Übungsanweisungen
- Create a local
numericvariable named@RideHrs. - Use
EXECto execute theSumRideHrsSingleDayfunction and pass'3/5/2018'as the input parameter. - Store the result of the function in
@RideHrsvariable.
Interaktive praktische Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
-- Create @RideHrs
___ ___ AS ___
-- Execute SumRideHrsSingleDay function and store the result in @RideHrs
___ ___ = dbo.___ @DateParm = '3/5/2018'
SELECT
'Total Ride Hours for 3/5/2018:',
@RideHrs