1、查询某个库中所有的表名字
Select [name] from sysObjects Where xtype='U'and [name]<>'dtproperties' Order By [name]
c.name As ColumnName,
t.name As TypeName
From syscolumns c, systypes t, sysobjects o
Where c.xtype = t.xusertype
And c.id = o.id
And o.name = 'Book'
Order By c.colorder
4、查询库中所有表的名字,以及表中数据的行数
SELECT a.name, b.rows
FROM sysobjects AS a INNER JOIN
sysindexes AS b ON a.id = b.id
WHERE (a.type = 'u') AND (b.indid IN (0, 1))
ORDER BY b.rows DESC
Select [name] from sysObjects Where xtype='U'and [name]<>'dtproperties' Order By [name]
2、得到数据库中所有用户视图
Select [name] From sysObjects Where xtype='V' And [name]<>'syssegments' And [name]<>'sysconstraints' Order By [name]
3、获得指定表中所有的列
Selectc.name As ColumnName,
t.name As TypeName
From syscolumns c, systypes t, sysobjects o
Where c.xtype = t.xusertype
And c.id = o.id
And o.name = 'Book'
Order By c.colorder
4、查询库中所有表的名字,以及表中数据的行数
SELECT a.name, b.rows
FROM sysobjects AS a INNER JOIN
sysindexes AS b ON a.id = b.id
WHERE (a.type = 'u') AND (b.indid IN (0, 1))
ORDER BY b.rows DESC