ODBC Server Reference Manual
Transact-SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
4-95
TRUNCATE TABLE
TRUNCATE TABLE
Use TRUNCATE TABLE to remove all rows in a table.
The TRUNCATE TABLE statement has the following syntax:
table-name
identifies the table to be truncated. The table name can be qualified with the
database name and owner name.
Examples
The following statement removes all rows from the EMPLOYEE table:
use test_disk01_persnl
truncate table employee
NonStop ODBC Server Compared With SQL Server
When used through the NonStop ODBC Server, TRUNCATE TABLE differs from the
SQL Server implementation in the following way:
NonStop ODBC Server Compared With NonStop SQL/MP
The corresponding NonStop SQL/MP statement is DELETE.
Executing the TRUNCATE TABLE statement is the same as executing the following
DELETE statement:
DELETE table-name
For example, both of the following statements used with the NonStop ODBC Server
remove all rows from the EMPLOYEE table:
truncate table employee
delete employee
TRUNCATE TABLE [ [database.]owner. ] table-name
Feature In SQL Server
In Programs Used With the NonStop
ODBC Server
Are changes written to the
audit log?
No Yes. NonStop SQL/MP does not have a
TRUNCATE TABLE statement, so a
DELETE statement is executed instead.