Click here to Skip to main content
15,888,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have two tables namely 'stock(ItemName,Quantity)' and WeeklyStock(ItemName,StartQuantity,date).

I want to update WeeklyStock table from stock table at the end of the week(on sunday 1:00 am automatically) when the server date and time becomes sunday 1:00am.

I mean every item listed in table "stock" should be inserted to the "WeeklyTable" table at the end of week, please advice me as to how this can be achived ?
Posted
Updated 10-Apr-12 20:08pm
v13
Comments
tulasiram3975 5-Apr-12 2:17am    
Better Do it in server side Check Dates And Do Your Work..
member60 5-Apr-12 2:28am    
why did you think of trigger first ?
Bala Selvanayagam 9-Apr-12 7:30am    
SQL Scheduled Job may be the asnwer for your question.

Having said that you are saysing its not shown. Can you please go into more detail and tell us what version of SQL server you are using ?
Member 7909353 11-Apr-12 0:44am    
I am using sql 2005
Bala Selvanayagam 11-Apr-12 2:14am    
What specific version in SQL 2005 ? express / standard / enterprise ?

No use a SQL Job - assuming you are using SQL Server. The Job should execute a stored procedure that updates your weekly data table.
 
Share this answer
 
Comments
SDAP_INDIA 5-Apr-12 6:14am    
yessssss
Member 7909353 9-Apr-12 2:52am    
How to set stored procedure to my table(WeeklyTable).
Mycroft Holmes 9-Apr-12 3:49am    
First create and test your stored procedure. Then in the job definition you can enter the name of the stroed procedure
Hi,

Follow Schedule a job link, it may help you,

thanks
-Amit.
 
Share this answer
 
Comments
Member 7909353 9-Apr-12 2:53am    
SQL Server Agent does not shown.
AmitGajjar 9-Apr-12 2:56am    
What version of SQL server you are using ?
Member 7909353 11-Apr-12 1:33am    
I am using sql 2005.
AmitGajjar 11-Apr-12 2:02am    
i mean Express edition / Enterprise edition ? or what else ?
Member 7909353 13-Apr-12 8:39am    
sql 2005 express.

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