April 4, 2008 at 2:33 pm
I created a simple SSIS pkg. I created connections, t-sql source data, with excel worksheet as destination. And emailed the spreadsheet to myself. Works fine.
Except I cannot find the option/switch/element that will truncate or delete the prior data when the pkg is run again. So the data appends. I tried using either the 'worksheet' or 'worksheet$'. I thought that made the difference in DTS. I looked for a way to run a t-sql script prior to calling my source script (DELETE FROM 'worksheet'), but I couldn't find an element to hold and run that script.
So, now I thought I would ask for help. Thanks
April 4, 2008 at 2:51 pm
you could use the file system task to delete the file and recreate it first, but there should be an easier solution I would think
April 7, 2008 at 6:54 am
You can run the DELETE statement as you suggested with a SQL Command task in your control flow.
Rather than doing this, I tend to keep a template spreadsheet with no data in it and use a file system task to replace the output file with the template prior to the data flow task. I have found this to be faster than using a SQL command and a DELETE statement.
April 8, 2008 at 11:02 am
Thanks All. After having no success creating a 'DELETE FROM. . .', I set up the File task. It was much easier, and very quick, using the copy file [template, as suggested] and overwrite my existing xls. Thank you.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply