Index: library/Zend/Db/Adapter/Pdo/Mssql.php =================================================================== --- library/Zend/Db/Adapter/Pdo/Mssql.php (revision 17661) +++ library/Zend/Db/Adapter/Pdo/Mssql.php (working copy) @@ -218,10 +218,20 @@ */ public function describeTable($tableName, $schemaName = null) { + if (!is_null($schemaName)) { + if (strpos($schemaName, '.') !== false) { + $result = explode('.', $schemaName); + $schemaName = $result[1]; + } + } /** * Discover metadata information about this table. */ $sql = "exec sp_columns @table_name = " . $this->quoteIdentifier($tableName, true); + if (!is_null($schemaName)) { + $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true); + } + $stmt = $this->query($sql); $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); @@ -239,6 +249,10 @@ * Discover primary key column(s) for this table. */ $sql = "exec sp_pkeys @table_name = " . $this->quoteIdentifier($tableName, true); + if (!is_null($schemaName)) { + $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true); + } + $stmt = $this->query($sql); $primaryKeysResult = $stmt->fetchAll(Zend_Db::FETCH_NUM); $primaryKeyColumn = array(); @@ -378,4 +392,4 @@ return null; } } -} \ No newline at end of file +}