1.获取所有数据库名:
select name from master..sysdatabases order by name
2.获取所有表名:
select name from databasename..sysobjects where xtype='u' order by name
xtype='u':表示所有用户表;
xtype='s':表示所有系统表;
3.获取所有字段名:
select name from syscolumns where id=object_id('tablename')
