Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to insert data that are present in one table viz:FAS to another table viz:FAS_Quarter for every 3 months once automatically using the scheduler,by retaining the data that was inserted for previous quarter also in the FAS_Quarter table.I want stored procedure to do this work using the scheduler.

Can anybody help me how to achieve this using scheduler by using stored procedure

Thanks and Regards
Spoorthi G S

What I have tried:

I am able to insert data from FAS to FAS_Quarter normally but not with scheduler ,how can i do this

The snippet of code that i have tried out:
insert into FAS_Quarter (CompanyCode,Year,Month,AssetNumber,SESAID,ProcessingYearMonth,CreateId,CreateDate,UpdateId,UpdateDate)
select f.CompanyCode,f.Year,f.Month,f.AssetNumber,f.SESAID,CASE
WHEN MONTH(YEAR) BETWEEN 1 AND 3 THEN convert(char(4), YEAR(YEAR) - 1) + '03'
WHEN MONTH(YEAR) BETWEEN 4 AND 6 THEN convert(char(4), YEAR(YEAR) - 1) + '06'
WHEN MONTH(YEAR) BETWEEN 7 AND 9 THEN convert(char(4), YEAR(YEAR) - 0) + '09'
WHEN MONTH(YEAR) BETWEEN 10 AND 12 THEN convert(char(4), YEAR(YEAR) - 0) + '12'
END AS ProcessingYearMonth,f.CreateId,f.CreateDate,f.UpdateId,f.UpdateDate from FAS f

Please help me by using scheduler .
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900