SQl查询数据库表名、表的列名 - 桦林
select name from sysobjects where xtype=\’u\’
–读取指定表的所有列名
select name from syscolumns where id=(select max(id) from sysobjects where xtype=\’u\’ and name=\’表名\’)
–读取指定表的所有列名
select name from syscolumns where id=(select max(id) from sysobjects where xtype=\’u\’ and name=\’表名\’)