Tuesday, January 30, 2007

Get list of changed stored procedures

Create the sp, in your database, and input from- and to-date. It will return a list of all stores procedures created and changed within that period of time in your database.


CREATE PROCEDURE sp_hlp_HentNavnePaaAendredeSPere
@StartDato DATETIME,
@SlutDato DATETIME
AS
select
'Name' = o.name,
o.create_date,
o.modify_date,
'Owner' = user_name(ObjectProperty( object_id, 'ownerid')),
'Object_type' = substring(v.name,5,31)
from sys.all_objects o, master.dbo.spt_values v
where
o.type = substring(v.name,1,2) collate database_default and
v.type = 'O9T' AND
substring(v.name,5,31) = 'stored procedure' AND
o.modify_date BETWEEN @StartDato AND @SlutDato
order by
o.modify_date desc,
Object_type desc,
Name asc

0 Comments:

Post a Comment

<< Home