1.怎样取得该服务器上的数据库数及数据库名称等信息?
exec sp_databases
select * from sysdatabases
2.怎样取得某个数据库中表的个数?
select name from sysobjects where xtype='u'
sp_tables
select * from INFORMATION_SCHEMA.TABLES
select * from sysobjects where xtype='U' and status>0
都可以,你要求个数:
select count(*) from sysobjects where xtype='U' and status>0
1.怎样取得该服务器上的数据库数及数据库名称等信息?
exec sp_databases
select * from sysdatabases
2.怎样取得某个数据库中表的个数?
select name from sysobjects where xtype='u'
sp_tables
select * from INFORMATION_SCHEMA.TABLES
select * from sysobjects where xtype='U' and status>0
都可以,你要求个数:
select count(*) from sysobjects where xtype='U' and status>0