update a column based on Ideal

  • hi,

    when the table is ideal or not access in sql server for some time say for 3 hours then i need to update the one column in that table as flag 1.

    i will update my last_modified_date when there is an select/update/insert/delete, so based on last_modified_date i need to maintain the session for 3 hours and close the same when it pass 3 hours.

  • Where/what is the question ?

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • when there is no access to select/update/insert/delete for a particular time then needs to update the state automatically.

  • So you're basically wanting to kick users out if they haven't worked on the table in the previous 3 hours?

    Or are you just wanting to flag records which haven't been changed in the previous 3 hours?

    I suspect your best bet is to run a scheduled/timed SQL Server agent Job, using getdate() and datediff against the records in your table.

    You haven't really given enough information to provide an example, but if you throw up more info about exactly what you;re trying to do, I'm sure myself or someone else will be able to come up with what you're looking for...

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply