summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mssql/mssql_utility.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mssql/mssql_utility.php')
-rw-r--r--system/database/drivers/mssql/mssql_utility.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php
index 9ff92d41b..bc398e7f7 100644
--- a/system/database/drivers/mssql/mssql_utility.php
+++ b/system/database/drivers/mssql/mssql_utility.php
@@ -52,6 +52,29 @@ class CI_DB_mssql_utility extends CI_DB_utility {
}
// --------------------------------------------------------------------
+
+ /**
+ * List databases
+ *
+ * @access public
+ * @return bool
+ */
+ function list_databases()
+ {
+ $query = $this->db->query("EXEC sp_helpdb"); // Can also be: EXEC sp_databases
+ $dbs = array();
+ if ($query->num_rows() > 0)
+ {
+ foreach ($query->result_array() as $row)
+ {
+ $dbs[] = current($row);
+ }
+ }
+
+ return $dbs;
+ }
+
+ // --------------------------------------------------------------------
/**
* Version number query string