title: Time-Bound Query In SQL Server
body: <p>I am working on a project where one of the parts processes the payment and if payment is successful, it sets a flag into the database. Now, what I want to achieve is that I have to keep querying into the database for that particular flag every second or every two seconds for 30 seconds. If I don't see that flag into the database after 30 seconds, I would say to the user that payment was unsuccessful. How do I achieve this time-bound querying? I mean how do i keep running a particular query for 30 seconds?</p>
  
  <p>Thanks.</p>