How to hide the data

  • OK ... I was in test for DBA for our Goverment and I had this question:

    the very important data about sales Goverment should be hide after one year ( e.g. all the data from 01/01/2007 to 31/12/2007 they will not see from anyone just from auditors if they decide to view these data in 2008) and it will happend every year!

    I have idea to make a view cuting with date "Between first_date AND last_date"

    do we have any other solutions, any other suggestion plz, couz I'm not sure if this is one of solutions !?

    thnx!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • All depends on how you want to manage. Sounds like the view may do what you want but could be a stored procedure or your pplication could handle limiting the view size. Ultimately thou as long as the data is in the primary table there could be a way to get at it depending on your users interface.

  • hmm about store procedure it is not bad idea!

    I will try to write the script for that "sp" with parameters "@firstdate and @lastdate"

    and this is second solution as I see from your reply!

    but which is the best or any other solution!?

    many thnx Antares686!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Neither is necessarily better. If you have a view, you can create the view and apply a filter in the WHERE clause that limits data.

    Perhaps you should try a few queries to show what you want and don't want and then wrap a view around it.

  • thnx Steve for the little suggestion!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

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

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