1. Learn
  2. /
  3. Courses
  4. /
  5. Writing Functions and Stored Procedures in SQL Server

Exercise

INSERT INTO @TABLE

Instead of storing static values in a table variable, let's store the result of a query.

Instructions

100 XP
  • Declare a TABLE variable named @RideDates with the following columns RideStart and RideEnd.
  • Both table variable columns should be date data type.
  • SELECT the unique values of StartDate and EndDate from the CapitalBikeShare table. CAST them from datetime to date data types.
  • Store the query results in @RideDates.