Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

how to insert one table data to another table by sql query in every day automatically in 1 pm.

thanks in advance
Posted

Once again you could run a SQL job [^]and insert into tables as and when required.
 
Share this answer
 
Comments
K N R 5-Oct-11 1:43am    
Hi abhinav,

thanks for your reply. but i want query with specific time

thanks.
Simon Bang Terkildsen 5-Oct-11 1:49am    
Just follow the guide Abhinav S provided you.. you'll see you can schedule the job when you create it..
Abhinav S 5-Oct-11 1:55am    
Just use Simon's query in a job and things should work.
Espen Harlinn 5-Oct-11 18:14pm    
Excellent as usual :)
Abhinav S 6-Oct-11 7:28am    
Thank you.
SQL
insert into table1 (col1, col2, col3) select col1, col2, col3 from table2
 
Share this answer
 
v2
Comments
Abhinav S 5-Oct-11 1:41am    
My 4 this time. You missed out that he needs to run the query at a particular time daily.
Simon Bang Terkildsen 5-Oct-11 1:43am    
So I did, thank you for notifying me and providing the info. You got my vote
K N R 5-Oct-11 2:04am    
is it possible to write where condition in table1
Simon Bang Terkildsen 5-Oct-11 2:09am    
if you mean table2 yes, doesn't make sense for table1, e.g.
insert into table1 (col1, col2, col3) select col1, col2, col3 from table2 where col1 = '12' and col42 is null

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