Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    3

    Unanswered: Trigger on a timer

    Can anyone explain how to fire a trigger based on a timer (say...every 30 seconds)? Can this be done completely within SQL code?

    TIA

  2. #2
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    A trigger cannot be fired on a timely basis, it fires for example on inserts. What you could do is write a procedure and schedule it to run on a certain interval.
    Johan

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I think the smallest time increment for the scheduler is 1 minute. If you need something more frequent than that then create a store procedure with an endless loop and a timer.

    blindman

  4. #4
    Join Date
    Sep 2003
    Posts
    3

    hmmmmm

    I gotcha. So, build a job and run it every few minutes? That sounds good.

    I need to update one database with the data from another database on a regular basis. If I do this with a job, will I be able to only copy over the data that was added since my last job ran? This way, I don't have to copy the entire contents of the table each time.

    I'm sorry about all the newbie questions. I appreciate your help!

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You need to read up on SQL Server's replication functionality. There are some powerful tools for keeping databases synchronized.

    I'll warn you that they are not for newbies, but neither is the type of SQL programming you will need to do to implement and support the home-grown functionality you are developing.

    blindman

  6. #6
    Join Date
    Sep 2003
    Posts
    3

    Thanks

    Blindman

    Thanks for the frank input! I'll read-up on replication and see where my comfort level is.

    I appreciate the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •