I have a table and every row will have an ID, Date, and Value column. I want it so that every time a person accesses a page on my web site, a stored procedure will run that will insert a row for each day within a range IF that day doesn’t already exist.
The date range will be from 01/01/2012 until the Saturday before the current day (the day the page was accessed). The ID will auto-generate and the Value field will remain NULL/blank.
For example, if I accessed the page today, I would want a record in the table for every day between 01/01/2012 until 03/03/2012.
This gets all the days that don’t exist yet, and excludes rows after the previous Saturday.
Note that I assumed you would “reset” this once your calendar year rolled over.