SolvedPrivate

Changing the Value of a variable on the fly in SSIS

Posted on 2014-09-12
10
28 Views
Last Modified: 2016-02-11
Good morning,

I have three loops that i need to run to get files from folders. I have one variable called @table_name that i want to use to update the table, (thru a sp). and input the file name that i just looped thru in the table. The table name will change for each file type.  so, i'll use dynamic sql in the sp, and pass in the variable name (table). Initially this works fine, but i can't figure out the best way to update the variable. Would it be better to do this with a derrived column ? though, i though that would work, i keep getting an error (something about conversion).
0
Comment
Question by:basile
  • 4
  • 3
10 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
Comment Utility
>can't figure out the best way to update the variable.
Note quite following you, but to update a variable 'on the fly' in SSIS create a script task, pass the variable that has the value as read only, pass the variable name to be updated as read-write, and using VB code the script will go like this:

Dts.Variable("variable_name_to_write_to").Value = Dts.Variable("variable_name_to_write_from").Value
0
 
LVL 1

Author Comment

by:basile
Comment Utility
I've requested that this question be deleted for the following reason:

I couldn't get an answer for this question.
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
Uhh, no.  Please work with experts when they make comments.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:basile
Comment Utility
I don't understand? I didn't get the answer I was looking for... Should I give the credit anyway?
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
>I didn't get the answer I was looking for...
And you didn't respond to expert comments either.  So, please spell out how we would know 'what you are looking for' if there is no follow-up between asker and expert.  Vulcan mind meld?  The Force?   Most experts are not going to write a book based on a five line question with no follow-ups.

I'm not intentionally trying to be rude here, but askers have an obligation to work with the experts that are trying to help.
0
 
LVL 1

Author Comment

by:basile
Comment Utility
ok, not taking anythign as being  rude. it was my fault. I was able to figure out a solution. I could care less about the points, so i can award them. i apologize for not following protocol, i've been on here a long time, and i've never had an issue.
0
 
LVL 65

Expert Comment

by:Jim Horn
Comment Utility
np
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In couple weeks ago, I encountered an extremely difficult problem while deploying 2008 SSIS packages to a new environment (SQL Server 2014 standard).  My scenario is: We have one C# application that is calling 2008R2 SSIS packages to load text fi…
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

15 Experts available now in Live!

Get 1:1 Help Now