I have a temp table with 2 date columns BEGDATE and ENDDATE. I need to be able to create records, 1 for each month from the BEGDATE to the ENDDATE, using the end of each month date.
So for a record with a BEGDATE of 10/09/2013 and an ENDDATE of 3/29/2014, I need records as follows
I can presently do this with a cursor, but with over 100000 records, you can imagine how SLOOOOOWWW it is.
Any thoughts on how to accomplish this?
I have attached my procedure code to assist in the process.