Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table #sp_lock (
- spid smallint,
- dbid smallint,
- objid int,
- indid smallint,
- type nchar(4),
- resource nchar(32),
- mode nvarchar(8),
- status nvarchar(5)
- )
- insert into #sp_lock exec sp_lock
- alter table #sp_lock add objname nvarchar(200) null
- exec sp_MSforeachdb @command1 = '
- use ?
- update #sp_lock set objname = object_name(objid) where dbid = db_id(''?'')
- '
- go
- select db_name(dbid) as dbname, objid, objname, count(*) as count from #sp_lock group by dbid, objid, objname order by dbid, objname, objid
- drop table #sp_lock
- go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement