You are here

public function TruncateQuery_sqlsrv::__toString in Drupal driver for SQL Server and SQL Azure 7

Same name and namespace in other branches
  1. 7.3 sqlsrv/query.inc \TruncateQuery_sqlsrv::__toString()
  2. 7.2 sqlsrv/query.inc \TruncateQuery_sqlsrv::__toString()

Implements PHP magic __toString method to convert the query to a string.

Return value

string The prepared statement.

Overrides TruncateQuery::__toString

File

sqlsrv/query.inc, line 310

Class

TruncateQuery_sqlsrv
SQL Server-specific implementation of TRUNCATE.

Code

public function __toString() {

  // Create a sanitized comment string to prepend to the query.
  $prefix = $this->connection
    ->makeComment($this->comments);
  return $prefix . 'TRUNCATE TABLE {' . $this->connection
    ->escapeTable($this->table) . '} ';
}