You are here

public function Truncate::execute in Drupal driver for SQL Server and SQL Azure 3.0.x

Same name and namespace in other branches
  1. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Truncate.php \Drupal\Driver\Database\sqlsrv\Truncate::execute()
  2. 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Truncate.php \Drupal\Driver\Database\sqlsrv\Truncate::execute()

Executes the TRUNCATE query.

Return value

Return value is dependent on whether the executed SQL statement is a TRUNCATE or a DELETE. TRUNCATE is DDL and no information on affected rows is available. DELETE is DML and will return the number of affected rows. In general, do not rely on the value returned by this method in calling code.

Overrides Truncate::execute

See also

https://learnsql.com/blog/difference-between-truncate-delete-and-drop-ta...

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Truncate.php, line 17

Class

Truncate
General class for an abstracted TRUNCATE operation.

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function execute() {
  return $this->connection
    ->query((string) $this, [], $this->queryOptions);
}