误解了,use test select * from sysobjects where type='u'
use test go select * from test
计算一个库里各个表的记录总数: select b.name,a.rowcnt from sysindexes a,sysobjects b where a.id=b.id and a.indid<2 and b.xtype='u'--统计数据库里每个表的详细情况 EXEC sp_MSforeachtable @command1="sp_spaceused '?'" --获得每个表的记录数和容量: EXEC sp_MSforeachtable @command1="print '?'", @command2="sp_spaceused '?'", @command3= "SELECT count(*) FROM ? "
20、说明:列出数据库里所有的表名 select name from sysobjects where type='U' 21、说明:列出表里的所有的列 select name from syscolumns where id=object_id('TableName')
select * from b....
select * from sysobjects where type='u'
go
select * from test
select b.name,a.rowcnt from sysindexes a,sysobjects b
where a.id=b.id and a.indid<2 and b.xtype='u'--统计数据库里每个表的详细情况
EXEC sp_MSforeachtable @command1="sp_spaceused '?'" --获得每个表的记录数和容量:
EXEC sp_MSforeachtable @command1="print '?'",
@command2="sp_spaceused '?'",
@command3= "SELECT count(*) FROM ? "
select name from sysobjects where type='U' 21、说明:列出表里的所有的列
select name from syscolumns where id=object_id('TableName')
谢谢你们!
select * from sysobjects where type='u'