Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stored procedure modified time

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!

like image 676
Books Avatar asked Mar 23 '10 00:03

Books


People also ask

Can stored procedures be modified?

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.

How do you check when a stored procedure was last modified in Oracle?

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.


1 Answers

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')
like image 182
nivlam Avatar answered Oct 19 '22 09:10

nivlam