Link to home
Start Free TrialLog in
Avatar of SQLSearcher
SQLSearcher

asked on

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
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Maybe this video will help...

https://youtu.be/wCEVlOwxq-Y
Avatar of SQLSearcher
SQLSearcher

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much.