+ Reply to Thread
Results 1 to 4 of 4

Thread: Change data in database automatically

  1. #1
    Join Date
    Jul 2006
    Posts
    7

    Default Change data in database automatically

    I have a database of agent's listing that allows me to designate them as "new listings" or "Just Reduced", "Sold", etc. My rule is that I keep that designation for approximately 10 days on a listing and then remove it where it becomes just an available listing (no special designation). Currently, once a week, I go into the database and make any needed changes to the database manually. I can do that because when I change a desination to new listing, Just Reduced, etc, I have a date field indicating when the designation was added. Then I check the date field and if the date is 10 days or older, I revert the designation back to available.

    I would like to automate this process so that once a day, something inspects the database and finds any listings with designation 10 days old (by inspecting the date field) and automatically changes the designation to available. I could have something on my computer that launches a script (asp) each night that will make the changes in the database, but is that the best way to do it??

    I look forward to some thoughts on this.

    Gary Letchford
    Letchford Design
    Longwood, FL

  2. #2
    Join Date
    Sep 2006
    Posts
    156

    Default Re: Change data in database automatically

    pixelduster, if you want to make that you should add the script on cron tab. From crontab you can add a script to run daily, exactly when you want. You can sure take the listings which are 10 days older and change another field on them.
    You'll just have to make a SELECT to take the listings which are 10 days older and after that an UPDATE to change the status field on them

  3. #3
    Join Date
    Jul 2006
    Posts
    7

    Default Re: Change data in database automatically

    Thanks DMike,

    Checking Google to gather more information about crontab. It appears to use crontab, you need to be on a Unix server. Being I am using asp, I am using a microsoft server. Am I missing something?

    Gary Letchford
    Letchford Design
    Longwood, FL

  4. #4
    Join Date
    Jan 2008
    Posts
    21

    Default Re: Change data in database automatically

    In Windows you can just use a scheduled task to run a script.

    You didn't mention what database you're using but if you're using SQL Server you can use a stored procedure to do all the sql work. After you make the stored procedure, you can use Enterprise Manager to create a Job to run it daily.

    Stored Procedures - http://msdn.microsoft.com/library/de..._adda_9tbk.asp

    Automating - http://msdn2.microsoft.com/en-us/library/aa213814.aspx
    Last edited by captainm; 02-05-2008 at 02:34 PM.

+ Reply to Thread

Similar Threads

  1. Google: Changes In Ranking Strategies
    By gonner in forum Google
    Replies: 13
    Last Post: 10-05-2007, 03:11 AM

Posting Permissions

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