SolvedPrivate

Changing the Value of a variable on the fly in SSIS

Posted on 2014-09-12
10
29 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
ID: 40319181
>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
ID: 40332433
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
ID: 40332434
Uhh, no.  Please work with experts when they make comments.
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 1

Author Comment

by:basile
ID: 40332816
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
ID: 40332927
>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
ID: 40333210
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
ID: 40333238
np
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 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

22 Experts available now in Live!

Get 1:1 Help Now