Script



My collection script :



Search what store procedure is using/calling the table/view/store procedure
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
    FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_DEFINITION LIKE '%textgoingsearch%'
    AND ROUTINE_TYPE='PROCEDURE'

Search what view is calling table/view
SELECT table_NAME, view_DEFINITION
    FROM INFORMATION_SCHEMA.views
    WHERE view_DEFINITION LIKE '%textgoingsearch%'



Store procedure change date
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P' 
order by 2 desc


Schema change
SELECT  sys.objects.name, sys.schemas.name AS schema_name, sys.objects.create_date,sys.objects.modify_date
FROM    sys.objects
INNER JOIN sys.schemas ON sys.objects.schema_id = sys.schemas.schema_id
inner join sys.sysobjects b  on sys.objects.object_id=b.id
where xtype='u'
 order by create_date desc

No comments: