1

I'm working on creating a maintenance job within SSIS and one of the steps requires me to read from a variable, check a value, and if that value is within a specific range, write that row to a new object for processing in a following step. I have the majority of the script written, but I can't quite put together how to write values to an object from within a script task.

Here's what I have now:

ssis_example

To quickly run through this, it grabs all database names from the server then runs a database integrity check. Following that it pulls up a list of all databases and their last known good integrity check. The final ForEach Loop is where I'm experiencing issues. I want it to take the object from the previous SQL task, read the variables, and if the last known good date is near the current time, feed it into a new object for use in a coming step to back that database up.

2
  • this might help : stackoverflow.com/questions/7880520/… Commented Mar 18, 2013 at 14:53
  • Since everything in the Execute SQL Task is going to be measured against current time, why not just do the logic in the query and only return the databases you care about. This greatly simplifies the logic and maintainability of what you are trying to do. Commented Mar 18, 2013 at 21:56

1 Answer 1

0

I would create a new Data Flow and use the current "Execute SQL Task" code for a new OLE DB Source. Then I would connect it to a Script Transformation (within the Data Flow) with your current "Script Task" logic. The Data Flow would be completed with a Recordset Destination, which would load the object variable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.