This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing a script to find the modified Stored Procedure and Table for last two days in SQL Server.
Using this script, DBA can easily monitor the changes of the object.
Below is a script:
1 2 3 4 5 6 7 8 9 10 11 |
SELECT SO.Name ,SS.name ,SO.type_desc ,SO.create_date ,SO.modify_date FROM sys.objects AS SO INNER JOIN sys.schemas AS SS ON SS.schema_id = SO.schema_id WHERE DATEDIFF(D,modify_date, GETDATE()) < 50 AND TYPE IN ('P','U') |
Type P: Stored Procedure
Type U: User Tables
Note: I filtered DATEDIFF only for last two days, as per your requirement you can change this value.