[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Insert a variable into a text file SSIS

Posted on 2010-01-05
4
Medium Priority
?
819 Views
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?
0
Comment
Question by:adammet04
4 Comments
 
LVL 30

Expert Comment

by:Reza Rad
ID: 26188932
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.
0
 
LVL 5

Assisted Solution

by:grzegorzs
grzegorzs earned 186 total points
ID: 26189403
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:

@[User::MyVariableName]

best regards
Grzegorz
0
 
LVL 22

Accepted Solution

by:
PedroCGD earned 189 total points
ID: 26190434
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:
http://pedrocgd.blogspot.com/2008/12/ssis-script-component-as-source-from.html

Regards,
Pedro
0
 
LVL 3

Author Closing Comment

by:adammet04
ID: 31673333
Thankyou for the Comments, I tried each one with varying success.
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ready to get certified? Check out some courses that help you prepare for third-party exams.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

868 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