Data Purge, please help

  • We are supporting a new application which is in the development stage. Prior to moving the application to production we need to clear all the test data that's already there in the tables. Application development team here, call it data purge.  There are foreign key relationship between many tables in the databases. Not all tables need to be cleared, for example table with all public holiday details should stay as it is. As a DBA, what steps we should propose to the Application development team to accomplish this? There are many databases and each database has many tables in it. If we know the proper steps and their proper sequence, we just need to repeat it for all tables in all databases. 

  • I think the easiest way would be to script out the entire database: you can right click on a database, select task and then Generate Scripts. In the advanced properties of the wizard you can choose to script out schema, data or both. So for the tables where you still need the data, you can script out the data as well.

    When everything is scripted, drop the database, recreate it and run the scripts.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 1 (of 1 total)

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