Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. run a process for every new entry in a database

run a process for every new entry in a database

Scheduled Pinned Locked Moved ASP.NET
databasequestion
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    liz3
    wrote on last edited by
    #1

    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?

    D Y 3 Replies Last reply
    0
    • L liz3

      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?

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      sounds like you are looking for a stored procedure which runs for every INSERT on a given table.

      L 1 Reply Last reply
      0
      • D David Mujica

        sounds like you are looking for a stored procedure which runs for every INSERT on a given table.

        L Offline
        L Offline
        liz3
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • L liz3

          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?

          Y Offline
          Y Offline
          Yusuf
          wrote on last edited by
          #4

          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[^]

          L 1 Reply Last reply
          0
          • Y Yusuf

            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[^]

            L Offline
            L Offline
            liz3
            wrote on last edited by
            #5

            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?

            Y 1 Reply Last reply
            0
            • L liz3

              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?

              Y Offline
              Y Offline
              Yusuf
              wrote on last edited by
              #6

              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[^]

              1 Reply Last reply
              0
              • L liz3

                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?

                D Offline
                D Offline
                David Mujica
                wrote on last edited by
                #7

                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.

                L 1 Reply Last reply
                0
                • D David Mujica

                  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.

                  L Offline
                  L Offline
                  liz3
                  wrote on last edited by
                  #8

                  thankyou! i'll try it out!

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups