|
I have an Excel spreadsheet that comes from an outside vendor. It has 16 boilerplate rows and then the data. I need to get rid of the 16 boilerplate rows. I approached this by bringing the entire spreadsheet into an SQL staging tablr and then deleting the top 16 rows. That worked except all of the numeric columns in the spreadsheet are null. For instance, the SSN of 123456789 which comes in the cell after STUDENT, JOHNNY. I think it is because the boilerplate rows are text but I am not sure. Any help? Thanks, Dick
(comments are locked)
|
|
You can try moving your header (Loan Type # of Disbursements or Cancellations..) so as to be the first line in the Sheet. Asuming your boilerplate rows have a single column, in SSIS, the query might look like: SELECT [Loan Type]
,[# of Disbursements or Cancellations]
FROM [SheetName$] Solution 2:
If this 16 no. of rows might change in time you can follow last post at http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/20944506-5276-41e7-8b65-7f36d6e4bdaa) To sum up, you can define 2 ranges in the Excel file: one for the additional rows(e.g. Summary) and one for the rows you are interested in (e.g.Detail) This way, in SSIS - EXCEL SOURCE - SQL command type: SELECT [Column1],[Column2] FROM [SheetName$RangeName] WHERE [Column1] is not null
If the format of the file stay fixed, just hard-code the range in the SQL command: e.g. SELECT * FROM [SheetName$A17:L70]
(comments are locked)
|
|
Not sure on the SSIS path at the moment but just for you to get the data into SQL Server try scripting it in with BCP or LogParser. These methods can accept a parameter that specifies the first row of data and should get you past your 16 rows. You may be getting the NULL values because of data type issues. Just as I have been typing this I have thought - can you create a named range in the spreadsheet and reference that from SSIS???
(comments are locked)
|
|
Would it be possible to save the Excel document as a CSV file and then import it using a Flat File Connection which allows you to skip a certain number of rows from the top of your data. Check out this URL for the possible options and below for a screen shot of the options.
(comments are locked)
|
|
This was the thing that did it: If the format of the file stay fixed, just hard-code the range in the SQL command: e.g. SELECT * FROM [SheetName$A17:L70] I didn't know you could run an SQL statement to filter the rows you were bringing in from an Excel spreadsheet. Thanks, Dick
(comments are locked)
|


