简体   繁体   中英

using script to row count ssis 2012

I have a large number of xls files and I would like to have a row count for each of the files to store in a report file which I will also use as a cache lookup in later stages. I dont want to create a source and rowcount component for each file (although I do have all the connection managers setup for them) Can this be done in a script?.

You can yes - create your script in SSIS and run some code like this

That said, it would probably be quicker to load it into a temporary table and then ditch the data - you can use a For Each to iterate through a folder location.

Points to note:

  • Different versions of Excel may have different ways of opening worksheets etc. Do you know that your version will always be (for example) Excel 2003?
  • A 64-bit instance of SSIS will not be able to access an Excel spreadsheet using 32-bit drivers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM