From 72496373008b263e098cf6082cdce1d47d01d3f1 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 25 Sep 2006 03:44:04 +0000 Subject: --- system/database/drivers/mssql/mssql_utility.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'system/database/drivers/mssql') 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 @@ -51,6 +51,29 @@ class CI_DB_mssql_utility extends CI_DB_utility { return $this->db->query("DROP DATABASE ".$this->db->_escape_table($name)); } + // -------------------------------------------------------------------- + + /** + * 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; + } + // -------------------------------------------------------------------- /** -- cgit v1.2.3-24-g4f1b