Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    151

    Exclamation Unanswered: Waiting on flag to activate Jobs ?

    is there a way to automate a job to wait on a flag in a directory and to start my maintenance plans ?

    if so how would i code is there external functions plz help.

  2. #2
    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    151
    Anyone. Where BREEEEEEEEEEEEEEEEETTTTTTTTT

  3. #3
    Join Date
    Jan 2005
    Location
    TempDb
    Posts
    228
    Yea - write a job that executes a DTS package that checks that flag every n minutes and then executes your maintenance plan when the flag is set. Dont' forget to reset your flag.
    I love deadlines. I like the whooshing sound they make as they fly by. Douglas Adams

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Brett is face first in snow somewhere. He should be back next week.

    If I had to trigger off of a file system object, I'd do something rather perverse like setting up a job that periodically checked for the file and kicked off the maintenance plan as needed.

    -PatP

  5. #5
    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    151
    that a good idea but can you guys give me a insight on how i would code this

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    INSERT INTO snow (id, desc)
       VALUES ('brett', 'face first')
    -PatP

  7. #7
    Join Date
    Jan 2005
    Location
    TempDb
    Posts
    228
    Build the DTS package.

    First, It should load your flag file and determine flag state (Florida, I think).

    Second, If the flag is not set, do nothing. If the flag is set, execute your maintenance plan.

    Next, after successful execution the maintenance plan, reset the flag.

    Finally, after you get this package working, right-click on the package and schedule it.
    I love deadlines. I like the whooshing sound they make as they fly by. Douglas Adams

  8. #8
    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    151
    sorry but i never used dts so iam no expert on this is any elaborated steps would be greatly aprecited ?

  9. #9
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Cheat? Create a SQL Agent Job that does it via a cmd (basically the same as a batch file). Supply your own job_id value, but something like:
    Code:
    IF not EXIST \\targetServer\targetShare\targetFile.go goto bail
    osql -E -Q "EXECUTE sp_start_job @job_id = 'muey foo'"
    IF errorlevel 0 rename \\targetServer\targetShare\targetFile.go targetFile.ok
    rename \\targetServer\targetShare\targetFile.go targetFile.err
       bail:
    -PatP

Posting Permissions

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