run a process for every new entry in a database
-
I need a process(say,timer) to start running for every new entry of a row in a database.I have no idea where to begin.Any suggestions?
sounds like you are looking for a stored procedure which runs for every INSERT on a given table.
-
sounds like you are looking for a stored procedure which runs for every INSERT on a given table.
yeah,almost.Well,to be more detailed...Im running a system where a user logs in his/her complaints and everytime a new complaint is registered, I need a timer to begin at the server-side.My database is running on SQL Server and the code for the system has so far been written in VB .NET How do i proceed?
-
I need a process(say,timer) to start running for every new entry of a row in a database.I have no idea where to begin.Any suggestions?
why do you want to run a timer for every new entry? It sounds overkill to me. Imagine how many timers you will be running. Can you modify your table schema? I'd add two or more columns 1. StartTime - This is the time when the record was entered 2. ModifyTime - [You may not need this one] This is the time when the record was modifed 3. EndTime - Time when you want to stop timer. Then at any given time you can compute time from those three columns. If you can not modify your table, consider adding new table to hold for your those times.
Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
-
why do you want to run a timer for every new entry? It sounds overkill to me. Imagine how many timers you will be running. Can you modify your table schema? I'd add two or more columns 1. StartTime - This is the time when the record was entered 2. ModifyTime - [You may not need this one] This is the time when the record was modifed 3. EndTime - Time when you want to stop timer. Then at any given time you can compute time from those three columns. If you can not modify your table, consider adding new table to hold for your those times.
Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
Yeah,it does look like overkill to me too.I already have those columns in the table.and i can always add few more if needed.but the point is that at the end of that time i need a process to run.This process is the same for all entries.How do i make it do that?
-
Yeah,it does look like overkill to me too.I already have those columns in the table.and i can always add few more if needed.but the point is that at the end of that time i need a process to run.This process is the same for all entries.How do i make it do that?
liz3 wrote:
but the point is that at the end of that time i need a process to run
well, your requirement are a bit blurry to me. Let me see if I got it right. What you want to do is whenever there is an entry to the table you want to run a timer then when some known time elapses, you want to execute something, right? First you can not do this using asp.net, period. you have two choices, you can write a standalone application, or even better windows service run your timer and what ever action you want. Or you can do it entirely within SQL server. For this you have to write a trigger and sql job. I prefer to write standalone application or service rather than do it in SQL.
Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
-
I need a process(say,timer) to start running for every new entry of a row in a database.I have no idea where to begin.Any suggestions?
I must have missunderstood your problem the first time. Let me give an example: 1) Trouble ticket is created at 9:00am 2) At 15 minutes after the ticket is created you need to check to see if it has been assigned to a suppoort representative, if not contact a supervisor as part of an escallation procedure. Is this something like what you are trying to solve ? One way to solve this is write a Windows service that checks the database at 2 minute intervals to see if escallation logic needs to be run. You would compare the start time of the trouble ticket and the status to determine what action is required.
-
I must have missunderstood your problem the first time. Let me give an example: 1) Trouble ticket is created at 9:00am 2) At 15 minutes after the ticket is created you need to check to see if it has been assigned to a suppoort representative, if not contact a supervisor as part of an escallation procedure. Is this something like what you are trying to solve ? One way to solve this is write a Windows service that checks the database at 2 minute intervals to see if escallation logic needs to be run. You would compare the start time of the trouble ticket and the status to determine what action is required.