public function Schema::getComment in Drupal driver for SQL Server and SQL Azure 3.0.x
Same name and namespace in other branches
- 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::getComment()
- 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::getComment()
Retrieve a table or column comment.
2 calls to Schema::getComment()
- Schema::changeField in drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Schema.php - Change a field definition.
- Schema::dropField in drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Schema.php - Should this be in a Transaction?
File
- drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Schema.php, line 2042
Class
Namespace
Drupal\Driver\Database\sqlsrvCode
public function getComment($table, $column = NULL) {
$prefixInfo = $this
->getPrefixInfo($table, TRUE);
$prefixed_table = $prefixInfo['table'];
$schema = $this
->getDefaultSchema();
$column_string = isset($column) ? "'Column','{$column}'" : "NULL,NULL";
$sql = "SELECT value FROM fn_listextendedproperty ('MS_Description','Schema','{$schema}','Table','{$prefixed_table}',{$column_string})";
$comment = $this->connection
->query($sql)
->fetchField();
return $comment;
}