0

Actually I have designed the package to overwrite the excel destination with OLEDB data source. I have 5000 records in my SQL server DB table. First time when the SISS package executed same numbers of records are copied to excel destination. 2nd execution on wards the same 5000 data are copied as new records in the same excel table. For example after 1st time execution the destination has 5000 records, 2nd time 10000, 3rd time 15000 and so on. But my aim is, the excel data should remain 5000 no matter how many times I would execute, until unless I modify the source data count. I use SQL Task to overwrite of the excel data. I used drop statement followed by create statement. Then also I am getting the data repeated in excel after successful execution of package.

Below is the code I have written for dropping and recreating the excel table in SQL task.

    DROP TABLE EXLDestination
    GO
    CREATE TABLE EXLDestination (
        `DatabaseLogID` DOUBLE PRECISION,
        `PostTime` DATETIME,
        `DatabaseUser` NVARCHAR(255)
    )
  • Welcome to SO! When you place a question try to add a minimum content: input sample, expected output sample, what did you try, research and where are you stacked. Try to clarify your question. – David García Bodego Oct 19 '19 at 06:15
  • I already edit your post. On SO, when someone is asking for clarification, please edit your post and add whatever required instead to comment it. – David García Bodego Oct 20 '19 at 05:03
  • OK. Thanks for your valuable suggestions. Now are you able to understand the issue that I am having or do I need to give more clarification. Can you please help me on this? – PRAMOD MALLICK Oct 29 '19 at 03:56
  • If you use `DROP TABLE` then you should realize that the data will be added. You should "clean" the destination first with: `DELETE * FROM [mySheet$]` whatever is you excel sheet – David García Bodego Oct 29 '19 at 04:09
  • I had already used delete statement like this before using drop statement. But same result I had have. Rows were repeated. – PRAMOD MALLICK Oct 29 '19 at 04:26

0 Answers0