locked
Data with short life span RRS feed

  • Question

  • I have a case where I have to use some data for a shorter life span. The application sends out product offers to the students based on a criteria. The criteria are many and the list of students data generated through the criteria are large. When the offer expires which is normally for a week the data that matters is only the students who have used the offer.

    The challenge I have it that the data is large and it grows very fast to thousands in a short time. Is a better approach to solve the issue of the data being used temporarily? I want to avoid the regular database maintenance.

    Sunday, July 1, 2012 2:56 PM

Answers

  • You can move the data into a archive database for future reports , see example that deletes the data in life db and move it to the archive.

    --SQL2008
    insert into fooArchive..FredArchive 
    select getdate(),d.*
    from (delete top (1000) 
            from foo..Fred
            output deleted.*) d
            go


    Best Regards,Uri Dimant SQL Server MVP,http://sqlblog.com/blogs/uri_dimant/

    Monday, July 2, 2012 4:53 AM