0

Hello Everyone, I am building up a webpage using asp.net which will populate data from a table@ my sql database. I need to copy data from one table to another for history purpose every 5 secs. My question: how can I implement a sql script which will run continuously on server, check and insert data from one table to another so that my webpage will refresh latest data every 5 secs? Also, is it possible to implement using asp.net only even if webpage is not opened?

This is my 1st web project so please bear with me. Responses are highly appreciated!

4

2 回答 2

0

You can go through this link to schedule an event Event Scheduler

Some useful links
mySQL daily backup from one table to another

Edit -1

But the best will be using trigger for your table. Example

MySQL trigger On Insert/Update events

于 2013-10-16T06:14:19.400 回答
0

Here are one of the few things u can do:

  1. Create a VIEW of the original table in the database you want the data to be accessible.
  2. Create a TRIGGER as Shekhar has suggested.
  3. Write a cron job which picks values from one table and inserts it in another. U can do this on the basis of creation_time/updation_time and you will need to handle duplication.

Solution 1&2 will work only when both the databases are on same mysql server while 3 will work otherwise as well.

于 2013-10-16T07:38:06.727 回答