SQL 2005 Agent Job using config variable for TSQL step

Posted on 2011-10-11
Last Modified: 2012-06-21

I have a job that I am running and 1 step has a config file, but I need another step to pull a variable from this same config file but the step is just a call to a SP (yes I need it to pull from config file) so I do not want to create another package just to call a SP when I can just use the TSQL step in the Agent Job.

I just need to know how to grab a variable from the config file when it runs from the TSQL code somehow
Question by:brad2575
    LVL 32

    Accepted Solution

    No can do - at least, not the way you are thinking of.  Make a global (package-wide) variable in your package, and when you are loading data in the step that uses the config file, load the value you will need later into your new global variable.  Then pass the value of that variable to the stored procedure as a parameter.
    LVL 16

    Author Closing Comment

    Giving points for trying to help.  As you said I couldn't do it that way, so just created an SSIS pkg with these steps and it worked, wanted to avoid an unnecessary package though.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now