sql server得到某个数据库的所有表和所有字段
select b.name tablename,a.name as columnname
from sys.columns a,
sys.objects b,
sys.types c
where a.object_id=b.object_id
and a.user_type_id=c.user_type_id
and b.type='u'
order by b.name
人生无止境,奋斗不息
select b.name tablename,a.name as columnname
from sys.columns a,
sys.objects b,
sys.types c
where a.object_id=b.object_id
and a.user_type_id=c.user_type_id
and b.type='u'
order by b.name