Diff of /adminer/drivers/mssql.inc.php [c8248b] .. [5f3709]  Maximize  Restore

  Switch to unified view

a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php
...
...
338
    }
338
    }
339
339
340
    function indexes($table, $connection2 = null) {
340
    function indexes($table, $connection2 = null) {
341
        $return = array();
341
        $return = array();
342
        // sp_statistics doesn't return information about primary key
342
        // sp_statistics doesn't return information about primary key
343
        foreach (get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name
343
        foreach (get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name, is_descending_key
344
FROM sys.indexes i
344
FROM sys.indexes i
345
INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
345
INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
346
INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
346
INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
347
WHERE OBJECT_NAME(i.object_id) = " . q($table)
347
WHERE OBJECT_NAME(i.object_id) = " . q($table)
348
        , $connection2) as $row) {
348
        , $connection2) as $row) {
349
          $name = $row["name"];
349
            $return[$row["name"]]["type"] = ($row["is_primary_key"] ? "PRIMARY" : ($row["is_unique"] ? "UNIQUE" : "INDEX"));
350
            $return[$name]["type"] = ($row["is_primary_key"] ? "PRIMARY" : ($row["is_unique"] ? "UNIQUE" : "INDEX"));
350
            $return[$row["name"]]["lengths"] = array();
351
            $return[$name]["lengths"] = array();
351
            $return[$row["name"]]["columns"][$row["key_ordinal"]] = $row["column_name"];
352
            $return[$name]["columns"][$row["key_ordinal"]] = $row["column_name"];
353
          $return[$name]["descs"][$row["key_ordinal"]] = ($row["is_descending_key"] ? '1' : null);
352
        }
354
        }
353
        return $return;
355
        return $return;
354
    }
356
    }
355
357
356
    function view($name) {
358
    function view($name) {

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks