Migrating TRUNCATE TABLE Statements from Oracle to SQL Server

The TRUNCATE TABLE statement is similar between Oracle and Microsoft® SQL Server™. It is used to remove all of the rows from a table. The table structure and all of its indexes will continue to exist; it cannot be rolled back. Delete triggers will not be executed. A table cannot be truncated if it is referenced by a FOREIGN KEY constraint.

Oracle SQL Server
TRUNCATE TABLE table_name
[{DROP | REUSE} STORAGE]
TRUNCATE TABLE table_name

In SQL Server, this statement can be issued only by the table owner. In Oracle, this command can be issued if you are the table owner or have the DELETE TABLE system privilege.

The Oracle TRUNCATE TABLE command can be directed to release or to keep the storage space occupied by the rows in the table. The SQL Server TRUNCATE TABLE statement always reclaims space occupied by the table data and its associated indexes.

See Also

TRUNCATE TABLE

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.