日期:2014-05-18  浏览次数:20606 次

怎样用sysobjects系统表得到含有默认值的用户表的名称和字段
select * from sysobjects where xtype='D'
我用上面这个语句查询的时候,表的名称和字段连在一起了,而且有些表名还不全,怎么办,请高手指点,谢谢!

------解决方案--------------------
SQL code
select * from sysobjects a,syscolumns b
where a.id=b.id and a.xtype='u'

------解决方案--------------------
楼上正解
------解决方案--------------------
SQL code
select a.name dbname, b.name colname from sysobjects a , syscolumns b where a.id=b.id and a.xtype = 'u' order by a.name , b.colid