record count from source Oracle database

  • I was wondering if someone would like to share their experience or method to get a record count for a source table in Oracle that I am importing using SSIS. I would like to update a metadata table in SQL Server with the recordcount of the table in the source.

    Not sure how to accomplish this task using Execute SQL Task. ideas?

  • Rather than use an execute SQL task, why not write the SELECT statement in the OLEDB source component in the dataflow?

    Then you use the recordcount component to populate a variable. After doing that you will have a variable to use within your process.

    Unfortunately my PLSQL skills aren't too hot... If it has to be an Execute SQL task you could find out if there is system variable like @@rowcount in SQL Server or maybe you just have to do a SELECT COUNT(*)?

    Hope this helps

    Kindest Regards,

    Frank Bazan

  • if _all_ you want it the number of records, the your best bet is to use the SQL task and run a select Count(1) From MyOracleTable and use the return value from that.

    There is not much point in pulling all the rows from Oracle and then throwing them into thin air just for the sake of counting them.

    If you are using the actual rows, then as suggested, use a Row Count component and assign the value to a variable. Using the onPostExecute event handler, log the value to SQL.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply