Deletion of data from tables based on how many times the report is run in SSIS
In my SSIS report , I have two files file1 and file2. I am creating a table in database based on the two files which have same record layout. My concern is after every three runs I need to clear the data of the previous run from the table for example when i am running the report for fourth time i should delete data of first run and soon. The report can run several times on the same day or only once per day. I tried a lot but couldn't come up with solution.Can some please help me in solving the problem. Thanks a lot Please do help me Never frown, even when you are sad, because you never know who is falling in love with your smile.
May 18th, 2011 5:11pm

Can you please describe your problem clearly? What do you mean by SSIS Report? What is in that files? Do you need to create multiple files?Thanks Ayyappan Thangaraj UG Lead, Puducherry, http://SQLServerRider.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2011 5:19pm

The OP wants to "age" files, and after 3 generations delete them. Like Alpha Beta Alpha1 Beta1 Alpha2 Beta2 Alpha3 Beta3 After aging Alpha1 Beta1 Alpha2 Beta2 Alpha3 Beta3 Alpha4 Beta4 Thus Alpha, Beta would be available for fresh use. Kalman Toth, SQL Server & BI Training; SQL 2008 GRAND SLAM
May 18th, 2011 7:50pm

I would keep a table with batch history. Meaning, a table like SQLUSA proposed, but where each row has a batch number. Those batch numbers are a sequence, e.g. 1,2,3,4 and so on. Either use an IDENTITY for this, or fill it up yourself if you don't want any gaps. In your table that contains the data, also include a column that contains the batch number for each row. Each time your SSIS package starts (package, not report), you check the history table and see if there is a batch number that equals the current batch number minus 3. If there is, delete all rows from the table which have a batch number equal to the one you just found.MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2011 2:24am

I have two flat files with data in them. I'm creating a temporary table which takes the values from two files having same layout. I am generating report based on the data stored in temporary table. I am using SSIS for this process. They can run the report multiple times in a day or once in a day. I need to have backup of three runs in my table before deleting the old data. For example if i run the program for 4 times i need to delete the data of first run similar like queue where it can hold data of only three runs. if queue is full than delete the first data in queue and soon.. I hope I am clear.
May 19th, 2011 10:24am

Thanks I will try this but I have a field load which stores current date and time. I need to delete my data based on it.
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2011 10:26am

Thanks I will try this but I have a field load which stores current date and time. I need to delete my data based on it. How will the current date and time help you determine how many runs there are in the queue?MCTS, MCITP - Please mark posts as answered where appropriate.
May 19th, 2011 10:27am

I have used queue has an example. In my database table I need to keep data from three runs. Even I don't have any clue on how to do that
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2011 10:30am

I am sorry .. I am entirely new to SSIS .. I have used queue has an example. In my database table I need to keep data from three runs. Even I don't know how i can determine based on that field
May 19th, 2011 10:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics