DTS to Delete Rows from excel output tab

  • Hi there-

    I hope I have the correct forum. I need to find a way to delete the data rows from my Excel template. I have a workbook formatted to be a template that catches data from a DTS extraction. I tried implementing the DROP TABLE command, but it a) Doesn't work and b) will drop the entire tab rather than truncate the data.

    Any help? Please? 😀

  • Mas (4/24/2008)


    Hi there-

    I hope I have the correct forum. I need to find a way to delete the data rows from my Excel template. I have a workbook formatted to be a template that catches data from a DTS extraction. I tried implementing the DROP TABLE command, but it a) Doesn't work and b) will drop the entire tab rather than truncate the data.

    Any help? Please? 😀

    Hello,

    If I'm not wrong the SQL syntax of the Drop statement for table doesn't work. The table name passed to it should be the same as it is given for table creation. You can have the table name when you create it will pop up as a window from which you need to copy the tablename. I'm not exactly sure at this moment how it is shown during creation.

    Hope this helps.

    Thanks


    Lucky

  • Thanks Lucky. The way I have it set up currently is:

    The Drop Table and the Create Table (both using a tablename of "Details") both in the same "Execute SQL Task" step. Then I query the DB using my code (in another step of course) then pump that to Excel.

    Maybe I shouldn't have the Create statement after the Drop?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply