Sql Server版:

列出当前DB中所有表:
select name from dbo.sysobjects where xtype='u' and (not name LIKE 'dtproperties')

列出表中所有字段:
SELECT dbo.sysobjects.name as Table_name, dbo.syscolumns.name AS Column_name
FROM dbo.syscolumns INNER JOIN
dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id
WHERE dbo.sysobjects.name='TM_User'and (dbo.sysobjects.xtype = 'u') AND (NOT (dbo.sysobjects.name LIKE 'dtproperties'))
Oracle版:

列出当前DB中所有表:
select table_name from user_all_tables

列出表中所有字段:
SELECT column_name from user_tab_columns where table_name='EDL_TM_User')
* 上面提到的TM_User和EDL_TM_User是提供查询的表名字,记得要换成你自己的