Data from the database in the work to export, but found that the exported Excel column names are field names (in English), to collect data on how to change the field name to Chinese names, and found that Oracle and SQL Server (SQLSERVER2008R2) is different, as follows:
SQL Server database:
system table:
---Get information about a table
SELECT * from SYS. OBJECTS
(Description: Name: Table name object_id: ID of table)
---Get information about a column
SELECT * from SYS. COLUMNS
(Description: Name: Column name object_id: Table ID column_id: Column ID)
---Get description information for a field
SELECT * from SYS. Extended_properties
(Description: major_id: The ID of the table minor_id: Column ID Value: The description of the field is the field comment)
---Get query statements for table name, column name, column description
SELECT a.name as ' table name ', b.name as ' column name ', C.value as ' column description '
From SYS. OBJECTS A left JOIN SYS. COLUMNS B on a.object_id=b.object_id
Left JOIN SYS. Extended_properties C on a.object_id=c.major_id
Oracle Database:
system table:
---Get the table name, column name, column description, field comments (if you query the field comments in a table in Oracle, you just need to query the table)
SELECT * from User_col_comments
(Description: table_name: Table name column_name: Field name comments: Field description is field comment)
---table describes the relevant information
SELECT * FROM User_tab_cols
(Description: table_name: Table name column_name: Field name)
SQL Server and Oracle system tables get table name names and comments for columns