I have this problem. I have to create an Excel 2007 file dynamically. To do so, I have an Excel connection with the "First Row Are Column Names" check uncheked. Then I created a SQL Task with that Excel connection and the following SQL Statement:
CREATE TABLE `MySheet` (`MyColumn` LongText)
And then I have a Data Flow Task that fills the sheet with a single-column stream of data.
The problem is that even though I unchecked the "First Row Are Column Names" check, the exporting still writes "MyColumn" in the first row. I need to be able to export the data from the first row onward, without any other thing being written on it.
This is a problem because there's the possibility that the Excel file must be overwritten by the SSIS package on a different run. Since we don't have deletion permits in the folder where the file is created, I need to delete the contents of the sheet from the previous run. I manage to do this using a SQL Task and the Excel connection with the statement:
DROP TABLE [MySheet]
This manages to erase every row without deleting the sheet. But, since this task is followed by the Data Flow Task instead of the sheet creation task (because the sheet is still there), when the Data Flow Task fills the rows again, it leaves the first row empty. It doesn't re-write the column name.
This difference is what I'm trying to avoid.
Is there any way to avoid this?
Thanks