Deleting rows in an excel file during job

Hello experts,

I have a table:
Column A      Column B
     A                             1
     B                             2
     C                             3
And an excel file with nothing but column headers:
Column A      Column B

I have setup a job to export the contents of the table to an excel file but first it should delete the rows in the excel file.  The job will run successfully the first time (when the excel is blank other than headers) but when you run the job subsequent times the last step fails with this error:
 "Executing the query "DELETE FROM `Sheet1$`  " failed with the following error: "Deleting data in a linked table is not supported by this ISAM.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  3:15:56 PM  Finished: 3:15:58 PM  Elapsed:  1.28 seconds.  The package execution failed.  The step failed."  

I have been researching the error and I know that importing from excel is not the same as actually manipulating the file from sql.  What I need to happen is to blank the excel file (other than headers) so that the data can be successfully written to the excel file.   Any ideas would be appreciated.
robthomas09Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
what kind of "job" are you setting up?

>>I have setup a job to export the contents of the table to an excel file but first it should delete the rows in the excel file.
are you trying to refresh an Excel file which linked to a database as source?

can you post relevant scripts or upload a sample here?
0
robthomas09Author Commented:
The package is simply a saved export data task that writes to an excel file.  The sql is as simple as it gets, select * from table,  and then the values are written to the excel file.  The table and excel file have matching columns and the excel file is simply the destination for the results to be written.
0
Ryan ChongCommented:
ok, then any reason why you need an excel file with nothing but column headers? why can't you export to a new excel file instead?
0
robthomas09Author Commented:
The excel is just a destination for quiery results.  If saved results as an excel not exported to an excel file the data saved all in column A.  I need column data in the correct columns which is the existing "blank" file other than column headings.
0
Ryan ChongCommented:
ok, so can you share your existing scripts and mention which line is hitting the error?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.