Insert a variable into a text file SSIS

Posted on 2010-01-05
Last Modified: 2013-11-10
I have a string from a CLR Stored Procedure i want to insert into a text file, i have tried various ways and i think at the moment the best way is maybe via a variable. Is it possible to insert a variable value into a text file via SSIS?
Question by:adammet04
    LVL 30

    Expert Comment

    by:Reza Rad
    You want to write a variable from SSIS to a text file?
    this is simply possible by script task
    just you need to open file in this task and write value of variable inside it.
    LVL 5

    Assisted Solution

    Another way is Derived Column transformation placed in data flow. For example if you want place value in text file with other data. In Derived Column transformation you add column with expression containing reference to your variable:


    best regards
    LVL 22

    Accepted Solution

    If you do it inside a DataFlow you need to have data in the pipeline...So, I suggest you to inside a Data Flow using a Script component as source to get the SSIS Variable value and then the flatfile destination to insert value.

    You can take a look to a script component as source here:

    LVL 3

    Author Closing Comment

    Thankyou for the Comments, I tried each one with varying success.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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

    In this article—a derivative of my blog post (—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    758 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

    10 Experts available now in Live!

    Get 1:1 Help Now