Open the desired log file with SQL Server Profiler. You can see the stored procedure name in the ObjectName column and the name of the user who modified the stored procedure name in the LoginName column.
SELECT name AS TableName, create_date AS CreatedDate, modify_date as ModifyDate FROM sys. tables order by ModifyDate; ...will tell me the last time a table was created and modified (from a DDL perspective).
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
ORDER BY modify_date DESC
The type
for a function is FN
rather than P
for procedure. Or you can filter on the name column.
Try this for stored procedures:
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
AND name = 'myProc'
This is the correct solution for finding a function:
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'fn'
AND name = 'fn_NAME'
I found this listed as the new technique
This is very detailed
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = N'PROCEDURE' and ROUTINE_SCHEMA = N'dbo'
order by LAST_ALTERED desc
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = N'PROCEDURE' and ROUTINE_SCHEMA = N'dbo'
order by CREATED desc
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = N'FUNCTION' and ROUTINE_SCHEMA = N'dbo'
order by LAST_ALTERED desc
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = N'FUNCTION' and ROUTINE_SCHEMA = N'dbo'
order by CREATED desc
For SQL 2000 I would use:
SELECT name, crdate, refdate
FROM sysobjects
WHERE type = 'P'
ORDER BY refdate desc
In latest version(2012 or more) we can get modified stored procedure detail by using this query
SELECT create_date, modify_date, name FROM sys.procedures
ORDER BY modify_date DESC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With