Solution to Activity 10.5
In this activity, you will create a stored procedure to determine dates, generate a passthrough query, and assign it to both date dropdowns. Follow the following steps to implement it:
- Create a new SQL file and name it
Create Procedure spDateRange_par.sql
to generate a stored procedure. - Open the file named
spCountryList_par.sql
and copy and paste all of its code into the new file. You will modify this code. - Continuing in the new file,
spDateRange_par.sql
, there are two locations where the stored procedure's name is referenced. Change these to the new name ofspDateRange_par.sql
. They are in the Drop Procedure and Create Procedure lines. - Include the parameters in the Create Procedure line. The parameters are
Tablename
andTheSeries
. Be sure to includeIN
and the data type declaration for both parameters. - Modify the SQL statement to return the
Year
field and set the series filter in theWHERE
clause. - We then need to develop SQL...