|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Saturday, July 18, 2009 5:10 PM
Points: 23,
Visits: 49
|
|
To preface, I am a newbie to SSIS. I would like to do the following but can not figure out how, any help would be appreciated.
I want to read multiple XML source files through a foreach loop. First looking to see if one field in the file exists and if so going to a data flow task and if it does not exists moving the file through File System Task and going to the next file.
I am aware of the conditional split data flow but how do I do a conditional statement in the control flow?
Thanks in advance.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 3:54 AM
Points: 265,
Visits: 200
|
|
Hi Michael,
You can use the variable expressions within the precedents constraints. You can store the results you want to check into a variable and then use this variable in an expression like (@varName == true) within the precedents constraints which then splits the flow to the tasks of your choice.
see msdn online : http://msdn.microsoft.com/en-us/library/ms140153(SQL.90).aspx
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Saturday, July 18, 2009 5:10 PM
Points: 23,
Visits: 49
|
|
Thank You.
Can I set a variable within the data flow task after a conditional split without using a script component (not sure how to write the code to do that)?
I was going to use XML source to a conditional split and then I want to set a variable to true or false based on the split. What is the easiest way to do that, w/o script code? Or if I need to use script code can you tell what it would be to just set a variable to true or false?
Thanks
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 2:19 PM
Points: 4,324,
Visits: 9,665
|
|
Assume that you have a Boolean variable called Test. Here is how you would set it to True using a Script Task.
1) Create a Script Task. 2) Add 'User::Test' (no quotes) to the ReadWriteVariables property. 3) Modify the definition of Public Sub Main as follows:
Public Sub Main()
Dts.Variables("Test").Value = True
Dts.TaskResult = Dts.Results.Success End Sub (Leave the rest of the Script Task code untouched.)
Job done.
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Saturday, July 18, 2009 5:10 PM
Points: 23,
Visits: 49
|
|
|
|
|