Script to clean up a database?

JTPro
JTPro Member Posts: 169
Hello all,

My employer wants me to write a script that will clean up whole database. They have already posted a lot of documents and made a lot of modification. They want to keep all setting and modifications, but delete all posted documents. Is it possible? Maybe someone has already written such script.

Need your help.

Best regards
JTPro
Navision Application Version: 4.0SP1
Navision Database Version: 4.0

Comments

  • DenSter
    DenSter Member Posts: 8,307
    Is that legal in Poland? Can you just delete all posted information from your financial system?

    Or are you talking about cleaning up a test system?
  • ara3n
    ara3n Member Posts: 9,258
    edited 2006-07-13
    standard navision has such thing it's If you go to setupchecklist. |THen click on Function->Implementation. On data cleaning tab you'll a button for clean. This wil clean al the transaction data. Afterwards check the table that still have records. File->database->info->tables. Find the ones that have still records and write a report to delete those.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Alex_Chow
    Alex_Chow Member Posts: 5,063
    Or you can use use the Date Compression function in Navision.
  • garak
    garak Member Posts: 3,263
    If you realy want to clear all Tables, take a look undet File \ Database \ Information \ Tables here you can see all tables with entries. Now you can write an report which delete all Records in that tables you are must clear.

    if you will not add evry table as variable use recref.
    Do you make it right, it works too!
  • andrejsm
    andrejsm Member Posts: 122
    Hi,
    You need to carefuly analyze which tables to clean up. Because ussually we don't want to delete setups and data which could be reused (customer, vendor cards e.c.)
    You can use Function from Setupchecklist, but be careful, this function have some issues. Some tables still have transactions data. If I remember correctly one of these tables are bank accounts ledger entries.
    Our company write special code unit for cleaning purposes. It is very useful after user trainings to delete transaction information, but still have all setups
    Andrejs Muraskins
  • Miklos_Hollender
    Miklos_Hollender Member Posts: 1,600
    JTPro,

    this is why I written this:

    http://mibuso.com/dlinfo.asp?FileID=580

    With this tool you gotta look at each table, press Ctrl+L and decide whether it should be deleted or not.

    It's about 2 hours (I tested it). But at least in this two hours you will get a profoung knowledge of Navi table structure :)
  • JTPro
    JTPro Member Posts: 169
    Thanks a lot guys.

    Im really apprieciate.

    The database is a test one, so there is no stress.

    Best regards

    JTPro
    Navision Application Version: 4.0SP1
    Navision Database Version: 4.0