You are here

public function Schema::getComment in Drupal driver for SQL Server and SQL Azure 8

Same name and namespace in other branches
  1. 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::getComment()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::getComment()

Retrieve a table or column comment.

1 call to Schema::getComment()
Schema::createDescriptionSql in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Return the SQL statement to create or update a description.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 1787
Definition of Drupal\Driver\Database\sqlsrv\Schema

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function getComment($table, $column = NULL) {
  $schema = $this->defaultSchema;
  $sql = "SELECT value FROM fn_listextendedproperty ('MS_Description','Schema','" . $schema . "','Table','" . $table . "',";
  if (isset($column)) {
    $sql .= "'Column','" . $column . "')";
  }
  else {
    $sql .= "NULL,NULL)";
  }
  $comment = $this->connection
    ->query($sql)
    ->fetchField();
  return $comment;
}