Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009

    Unanswered: How to Pass Parameter Values in SQL Job Schedule?

    Please Help me Guys ...

    I am facing the following problem and don't know how to get rid of ... Can AnyOne Help Me ...!

    I have a few Stored Procedures, which update my Database on the Daily Basis, I just had a Problem that I want these Procedures to be run automatically through SQL Job Scheduler. There are two Param which creating me the Problem:

    -- This will Complete a Day's Transactions
    @sDate (Starting Date as 07/15/2009 00:00:00)
    @eDate (Ending Date as 07/15/2009 23:00:00)

    -- I have to pass the Date 1 Day Less from the Current Date, e.g. Today is 15 of July so I have to pass the Date as 14 of July (Requirement of the Scenario)

    I just want to know that how I will be able to pass the Date values to the Param while creating SQL Server Job and it will automatically do the same for the rest of my life

    Execute DisposedMOPrePhase @sDate, @YearMonth

    --Please Help Me ... Thanks in Advance--

  2. #2
    Join Date
    Feb 2004
    One Flump in One Place
    declare a date variable. Use GETDATE() and DATEADD() to derive the date for yesterday. Pass that variable to the sproc. You can do it all in the job so there is no need to pass parameters to the job.
    pootle flump
    ur codings are working excelent.

Posting Permissions

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