Pass variables to SQL Server job?

I have  a SQL Server job that runs every morning and executes a series of 15 stored procedures.  Each of these SPs pulls data from my clients production database and stores it in a reporting database, but because of the ability of user to modify historical data (as much as 30 days back), I use MERGE procedures in each of these SP to Update and Insert records in the reporting DB.

Each of these SPs have variables @FromDate and @ThruDate defined in the SP allowing me to pass in specific dates, or to use the defaults GetDate() - 30 thru Today.

I like the fact that each of these procedures is run as a separate step of the daily job because occasionally, data entered into the production db will fail due to duplicates which fail the merge process, allowing me to determine where the process failed and investigate the failure.  However, I would like to be able to run the job and pass in a couple of dates, which would be used by all 15 of the SPs.  Is there a way to do this?

I know I can create a separate SP, which would run each of the 15 SPs, but this will not report failure at a specific step.
LVL 51
Dale FyeOwner, Developing Solutions LLCAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Create a job/control table, where you store the parameters. Read it in your procedures.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeOwner, Developing Solutions LLCAuthor Commented:
Thanks for your input, ste5an.

I had considered that was looking for other alternatives.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.