0

I have a scenario where I need to insert few records into database. I have analyzed and confirmed that only script component can help me.

Since I cannot give the exact data, I will explain the flow using sample data.

The main flow has employee records and employee id is the key.

there is a complex query which gets the row id based on rank and here the where clause should have employee id hard coded. Below is the sample only.

Select emp_name, location, designation from employee where emp_id = ? ;

My question is, how can I pull multiple values from query in script component ?

2
  • You can use the multiple array variables as in this link: stackoverflow.com/questions/11751901/… Commented Nov 19, 2013 at 19:11
  • @Learner Are you sure you need a script component? If you just need to execute possibly dynamic SQL, there are other ways in SSIS. Commented Nov 19, 2013 at 19:52

1 Answer 1

0

If your dataset has multiple rows returned and you're wanting to process those row by row, I would think you need to use a for loop container to get these one by one. Depending on volume of data this could become a performance issue. I would also question if the script task is the right tool for the job. It is flexible, but there are other ssis constructs that may serve you better.

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.