2016/9/22

常用SP查詢指令

--取得sp名稱https://msdn.microsoft.com/en-us/library/ms177596.aspx
select * from sysobjects where xtype='p'
--取得sp內容
select text, object_name(id) from sys.syscomments
where 1=1
and text like '%XXX%'
order by object_name(id)
--查詢db lock的table
select object_name(resource_associated_entity_id) as tablename,*
from sys.dm_tran_locks
where request_type='lock'

沒有留言:

張貼留言