Is there a way to find out when a stored procedure or table was last modified? I tried checking the properties via SQL Management Studio, but only found the creation date.
Thanks!
Transact-SQL stored procedures cannot be modified to be CLR stored procedures and vice versa. If the previous procedure definition was created using WITH ENCRYPTION or WITH RECOMPILE, these options are enabled only if they are included in the ALTER PROCEDURE statement.
Here's one way: SELECT owner , object_name , last_ddl_time FROM all_objects -- or dba_objects, if you have privileges WHERE object_type IN ('PROCEDURE') ORDER BY last_ddl_time ; You can't modify procedures; all you can do is CREATE or REPLACE them.
You can use this to find the last modified date for a stored procedure:
select name, create_date, modify_date
from sys.procedures
where name = 'sp_MyStoredProcedure'
You can use this to find the last modified date for a table:
select name, create_date, modify_date
from sys.tables
where name = 'MyTable'
To find the last modified date and other info for other objects, you can query sys.objects
. http://msdn.microsoft.com/en-us/library/ms190324.aspx contains a full list of types you can search for.
select top 10 *
from sys.objects
where type in ('p', 'u')
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