You are here

public function Scheme::DatabaseCreate in Drupal driver for SQL Server and SQL Azure 8.2

Create a database.

Parameters

string $name: Name of the database.

string $collation: Collation or empty for the default engine collation.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Scheme.php, line 715

Class

Scheme

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function DatabaseCreate($name, $collation = null) {

  // Create the database.
  if ($collation !== null) {
    $this->cnn
      ->query_execute("CREATE DATABASE {$name} COLLATE " . $collation);
  }
  else {
    $this->cnn
      ->query_execute("CREATE DATABASE {$name}");
  }
}