Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Writing Functions and Stored Procedures in SQL Server

Cursus bekijken

Oefeninstructies

  • Create a local numeric variable named @RideHrs.
  • Use EXEC to execute the SumRideHrsSingleDay function and pass '3/5/2018' as the input parameter.
  • Store the result of the function in @RideHrs variable.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

-- 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
Code bewerken en uitvoeren