Results 1 to 3 of 3

Thread: Job SQL 2000

  1. #1
    Join Date
    May 2010
    Posts
    52

    Unanswered: Job SQL 2000

    hi guys i want to create a job in SQL 2000. this job is supposed to help me delete data every month. i want to keep data that is for the past three month all the time.
    i have a stored proc that deletes data less than a date i enter. my question is can i use this SP in the step for the job i want to create? if so how do i go about it. how will the job know which date to delete since right now i enter the date when i run the SP. NOVICE to SQL

  2. #2
    Join Date
    Oct 2011
    Posts
    29
    This should be a good starting point to create a new job

    SQL Server Agent Jobs

    Since your SP accepts a date as parameter, In the job step you can write something like this

    declare targetdate datetime
    set targetdate=getdate()-90
    exec yourSP targetdate

  3. #3
    Join Date
    May 2010
    Posts
    52
    thanks DBA1, makes sense.....

Posting Permissions

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