SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


General Question - How best to validate an excel spreadsheet prior to running ssis pkg


General Question - How best to validate an excel spreadsheet prior to running ssis pkg

Author
Message
William Plourde
William Plourde
Old Hand
Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)

Group: General Forum Members
Points: 365 Visits: 349
I've been learning ssis on the job the hard way over the past several months. So far, so good. I have a process by which my users can import spreadsheet data into my database. In a nutshell..my C# winform app calls a stored procedure, the sp calls dtexec to run the ssis package for me.

So far this has been fine but it's weak on the validation of the spreadsheet prior to running the ssis pkg. Because my users receive their spreadsheets from other sources the layout of the spreadsheets is not always correct.

One of the things I do is capture the ssis output from each process and store it as part of my audit information, so luckily I can read thru the outputs. Needless to say the successful imports have nice short log files with success in them, and the errors have crazy long log files full of meta data errors that are difficult to sort thru.

So, in an effort to beef up my process, does anybody know of any processes by which I can validate my spreadsheets prior to importing them ? They are very simple, a handful of columns with the field names in the first row.

I would like to be able to at least validate the column names and sequence, and possibly the number of data rows in the spreadsheet.

I'm starting to think that I will have to open the spreadsheet in C# via ado and read the first row to do this. Other than that I'm pretty much clueless.

Does anybody have any experience with this sort of thing, or can anybody point me in the right direction ? I've never had the need to interrogate a spread sheet in this way and just need to get pointed in the right direction.

Thanks,
Bill
Phil Parkin
Phil Parkin
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26468 Visits: 20679
I would do it the way you suggest - but as part of the package. Step 1 - Script Task to validate spreadsheet format.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search