The sp_dboption system procedure supports the ability to remove residual data from deletions in SAP ASE.
sp_dboption dbname, "erase residual data", true
Example 1
The option to erase residual data is turned on for table t1 because it is set at the database level, so that both the drop table and truncate table commands for t1 result in the cleanup of all residual data from its pages.
create database db1 go sp_dboption db1, "erase residual data", true go use db1 go create table t1 (col int) go insert t1 values ... go create table t2 (col1 int, col2 char(10)) with "erase residual data" off go truncate table t1 go drop table t1 go truncate table t2 go drop table t2 go
Example 2
create database db1 go use db1 go create table t1 (col int) go sp_dboption db1, "erase residual data", true go create table t2 (col1 int, col2 char(10)) go create table t3 (col1 int, col2 char(10)) with "erase residual data" off go truncate table t1 go truncate table t2 go truncate table t3 go
When you enable this setting at the database level, any operation that results in deallocation is followed by the cleaning of its pages. By default, this option is disabled.
To set the database-level option using sp_dboption, the user must be a system administrator or database owner.