Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Automatic insert select based on server date?

    Hello,

    I have an ASP events calendar page with a SQL database of events. I'd like to have events that have past automatically moved to another table within the same database called past based on the server's current date. Is there a way to do this and trigger it perhaps upon loading the events calendar page in the web browser? I currently have to go to SQL Enterprise Manager and manually run two queries...

    First...
    insert into past (eventId, title, description, ceMonth, day_start, day_end, ceYear, url) from events where ceMonth < '12' and ceYear = '2005';

    Then...
    delete from events where ceMonth < '12' and ceYear = '2005';

    Thanks in advance,
    Anessa

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    in enterprise manager, you can schedule queries to run in a frequency of your choice
    I am the luckiest man in the world

  • #3
    New Coder
    Join Date
    Apr 2005
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Sweet!!! Thanks!


  •  

    Posting Permissions

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