SolvedPrivate

Changing the Value of a variable on the fly in SSIS

Posted on 2014-09-12
10
31 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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