Index: library/Zend/Db/Adapter/Pdo/Mssql.php =================================================================== --- library/Zend/Db/Adapter/Pdo/Mssql.php (revision 17870) +++ library/Zend/Db/Adapter/Pdo/Mssql.php (working copy) @@ -220,16 +220,22 @@ */ public function describeTable($tableName, $schemaName = null) { + $catalogName = null; if ($schemaName != null) { if (strpos($schemaName, '.') !== false) { $result = explode('.', $schemaName); $schemaName = $result[1]; + $catalogName = $result[0]; } } /** * Discover metadata information about this table. */ - $sql = "exec sp_columns @table_name = " . $this->quoteIdentifier($tableName, true); + $sql = "exec "; + if ($catalogName != null) { + $sql .= $catalogName.'..'; + } + $sql .= "sp_columns @table_name = " . $this->quoteIdentifier($tableName, true); if ($schemaName != null) { $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true); } @@ -250,7 +256,11 @@ /** * Discover primary key column(s) for this table. */ - $sql = "exec sp_pkeys @table_name = " . $this->quoteIdentifier($tableName, true); + $sql = "exec "; + if ($catalogName != null) { + $sql .= $catalogName.'..'; + } + $sql = "sp_pkeys @table_name = " . $this->quoteIdentifier($tableName, true); if ($schemaName != null) { $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true); } @@ -420,4 +430,4 @@ return null; } } -} \ No newline at end of file +}