Skip to content

Commit

Permalink
MS SQL views support
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed May 27, 2010
1 parent 3b1e9e7 commit fe3d395
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion adminer/drivers/mssql.inc.php
Expand Up @@ -360,6 +360,11 @@ function indexes($table, $connection2 = null) {
return $return;
}

function view($name) {
global $connection;
return array("select" => preg_replace('~^(?:[^`]|`[^`]*`)*\\s+AS\\s+~isU', '', $connection->result("SELECT view_definition FROM information_schema.views WHERE table_schema = SCHEMA_NAME() AND table_name = " . $connection->quote($name))));
}

function collations() {
$return = array();
foreach (get_vals("SELECT name FROM fn_helpcollations()") as $collation) {
Expand Down Expand Up @@ -553,7 +558,7 @@ function show_status() {
}

function support($feature) {
return ereg('^(scheme|trigger|drop_col)$', $feature); //! view|routine|
return ereg('^(scheme|trigger|view|drop_col)$', $feature); //! routine|
}

$jush = "mssql";
Expand Down

0 comments on commit fe3d395

Please sign in to comment.