genesisloha.blogg.se

Imagezilla lsn magazine
Imagezilla lsn magazine






So, immediately after the delete and truncate happens, we need to check when this particular transaction has been started and we need to record the log sequence numbers of these transactions. Step 7: Execute the following statement(s) to view the records in the table We’ve only two records in DeleteTest table and they have no records in TruncateTest table. So, let’s go ahead and view the tables status again. Step 6: Execute the following statement(s) perform delete and truncate operations Let’s assume that our developer, by mistake deleted some data from the table DeleteTest and truncate the table TruncateTest. So, we have five records in DeleteTest table and another five in TruncateTest table. Step 5: Execute the following statement(s) to view the records in the table Step 4: Execute the following statement(s) to insert records into the tables Now, insert five records each into the tables. TO DISK = 'C:\SQLMaestros\TruncatevsDelete.BAK' - Backup path may vary in your case

Imagezilla lsn magazine full#

Step 3: Execute the following statement(s) to take full backup of TruncatevsDelete database. Perform a full database backup before inserting the data into the tables. Test CHAR(20) DEFAULT 'Operation TRUNCATE'

imagezilla lsn magazine imagezilla lsn magazine

Step 2: Execute the following statement(s) to create tables Let’s create TruncatevsDelete database and then two tables DeleteTest & TruncateTest -Step 1: Execute the following statement(s) to create a databaseĪLTER DATABASE TruncatevsDelete SET SINGLE_USER WITH ROLLBACK IMMEDIATE Without any further delay let’s get in to the demos. In this blog we will prove the point that both the truncated and deleted data can be rolled back, if they are used in certain transactions with a proper database backup and restore mechanism. This article first appeared in the SQLServerGeeks Magazine.






Imagezilla lsn magazine