SSIS run SQL on Script Component

Hello Experts Exchange
I have a SSIS package that has a Recordset Destination, I then use a Script Component to get the data.

My SQL script is;

SELECT
      Sale_Date
    , Shop_Ref
    , ISNULL(SUM(CASE WHEN Category='Cat1' THEN [Price_Paid] END),0) AS Cat1
    , ISNULL(SUM(CASE WHEN Category='Cat2' THEN [Price_Paid] END),0) AS Cat2
    , ISNULL(SUM(CASE WHEN Category='Cat3' THEN [Price_Paid] END),0) AS Cat3
FROM SampleData
GROUP BY
      Sale_Date
    , Shop_Ref

Open in new window


I want to run the SQL script on the Script Component data, how do I do that in my SSIS package?

Regards

SQLSearcher
SQLSearcherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian CroweDatabase AdministratorCommented:
Maybe this video will help...

https://youtu.be/wCEVlOwxq-Y
0
SQLSearcherAuthor Commented:
Hello Brian
The script that I want to run is on all the records at once, but the example you have given me is to run on one record at a time.

Is it possible to run a script on a script component?

Regards

SQLSearcher
0
Brian CroweDatabase AdministratorCommented:
It looks like there might be a work-around to use a RecordSet Destination as a data source:

http://reallifebi.blogspot.com/2012/09/using-recordset-destination-in-data.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SQLSearcherAuthor Commented:
Thank you very much.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.