Update, re:
"Edit: The way that I update my table is I use MS Access, I copy from MS Excell about 10.000 rows and paste it to the database using MS Access. So when the copy paste is in progress, I want to be able see it from my web based program."
The principle is the same, at the start of your paste process, add a DB row, like in my first answer. Or, you could set a global variable in your web application, something like updateInProgress = true
.
But, how long does this copy take? If it's less than about 5 minutes, then it's probably not worth doing anything else.
If you just want to let the user know that there is "fresh" data, you could query for recent datetimes.
What kind of update? In the usual sense, SQL Server keeps the results accurate with default transaction locking.
Maybe you mean a long data-import job? Or, Heaven forbid, some intensive, cursor-driven process?
Then you could do something like:
Create a table in the database. Call it, say LongJobLog. It might have 3 columns: an ID, a start datetime, and an end datetime.
At the beginning of each long job, add a new start time to this table, be sure to save the new ID to a variable.
When the job ends, or errors out, update the ID's row with the endtime.
Your application would query this table for recent rows (by the start time) that still had a null end time. If such rows existed, then an "update" is in progress.
You'll probably need a cron job to clear out entries where jobs crashed.
Alternatively, this start-stop information is probably available in the SQL logs. It might take a bit of work to sort it out, though.