Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Schedule plan - Stored procedure

$
0
0

Hi Experts,

I have a requirement like below....Any ideas to achieve the same will be highly appreciated...

PLAN

Stored Procedure to run on 3rd, 9th, 16th & 23rd every month

On 3rd : delete data from [ControlReports] tbl for previous month and insert whole month's data.
On 9th : delete data for current month and insert data from 1st until 7th (2 days before)
On 16th : delete data for current month and insert data from 1st  until 14th (2 days before)
On 23rd : delete data for current month and insert data from 1st  until 21st (2 days before)

INSERT INTO [Control_Reports]
EXEC @return_value = [dbo].[rpt_spFeeManagement]
  @Products = NULL,
  @TransactionTypesOptionsFees = 'Refunds',
  @StartDate = 'mm/dd/yy',
  @EndDate = 'mm/dd/yy'

How do I make the process as generic as possible please.

Many thanks.



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>