Find Tables mostly used in Stored Procedures

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 245
Below query is used for getting tables which are mostly used in SP:-

select tbl.name as 'table name',count(1) as 'table count'
from information_schema.routines r
inner join sys.tables tbl on r.routine_name like ('%' + tbl.name + '%')
group by tbl.name
order by 'table count' desc;

Comments or Responses

Login to post response