- --适用MSSQL2000、MSSQL2005
- use master
- declare @dbid int
- Select @dbid = dbid from sysdatabases where name = 'Test'--修改成数据库的名称
- select
- dbid,UseCounts ,RefCounts,CacheObjtype,ObjType,
- DB_Name(dbid) as DatabaseName,SQL
- from syscacheobjects
- where dbid=@dbid
- order by dbid,useCounts desc,objtype
- --该片段来自于http://www.codesnippet.cn/detail/100520133250.html
来源: http://www.codesnippet.cn/detail/100520133250.html