Wednesday, October 26, 2011

MySQL : Preventing deletion of specific rows - Easy Method

Step 1: Create a backup table for the original table

Step 2: Create before delete trigger on both tables to secure the valid records at the time of deletion.


Step 3: Create a view with union on  both the tables.

Step 4: User can access the data using the view at any point of time.

Step 5: Delete operation will be executed on both the tables ( Original and Backup Table ).


No comments:

Post a Comment