Archiving Data

  • Hi,

    I have a table which contains

    1.DB Name

    2.Table Name

    3.Column Name

    It should choose the max(column Name is nothing but the name from above point 3) from a archived table - name is nothing but the name from above point 2.

    If it is not getting any values then, from the original table archive the data previous to 6 months to Archive DB .

    If it gets a value – from that date till the data previous to 6 months needs to archived.

    Idea behind is the original table should have 6 months of data always.

    Same way, it should store the same into a text file also.

    can anyone guide me on the steps to do the same.

    Thanks,

    ami

  • One solution would be to load: Database_name, Table_name and Column_name into a cursor then loop the cursor and process each table as needed.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Hi Paul,

    that can be done in a stored procedure. but how about doing the same in SSIS?

    i expect this to be done using for each loop and inside that some script tasks to do the same?

    thanks,

    ami.

  • Anamika (3/15/2012)


    that can be done in a stored procedure. but how about doing the same in SSIS?

    i expect this to be done using for each loop and inside that some script tasks to do the same?

    hey hey hey!... you said nothing about SSIS in your original post - love when specifications change on the fly 😀

    Have you tried the solution you described?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • yeah, that is working quite fine. and if i put that in a script task that also works fine. 🙂

    still, want to try that in SSIS 😀

    and sorry about not mentioning it correctly on the first time.

    thanks,

    regards,

    ami

Viewing 5 posts - 1 through 4 (of 4 total)

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