Skip to Content
1
Former Member
Aug 24, 2016 at 05:26 PM

Need help on update stat running through proc ..

42 Views

Version : 16

Executing update statistics through store proc . How to find on which table update statistics is running .

dbcc sqltext shows Proc_name .

sp_lock shows Sh_intent on ops..sysstatistics .

How to find on which table Update Statistics is running ..

Example :

create proc sp_test1

as

update index statistics XXX

go

excec sp_test1

go

From Other Session ..

dbcc sqltext(SPID) ---> Shows sp_test1

sp_lock <SPID>,@verbose=1

fid spid loid locktype partitionid page row objectName id class context

------ ------ ----------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------- ----------- ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------- ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

0 318 636 Sh_intent 0 0 0 ops..sysstatistics 24 Non Cursor Lock