What's Changed? | Database Journal

What’s Changed?

Written By
Alan Enderby
Alan Enderby
Oct 3, 2000
1 minute read

Someone fobbing you off saying nothing has changed ?

This script displays
the most recent object changes in the last nnn days.

Example
sp_objects 10
Will show any objects that have been (dropped and) created in
the last
10 days.

use master
go
if exists (select * from
sysobjects where id =
object_id(‘dbo.sp_objects’) and sysstat & 0xf =
4)
drop procedure dbo.sp_objects
GO

/****** Object: Stored
Procedure dbo.sq_objects Script Date:
04-Mar-98 1:46:20 PM
******/
create proc sp_objects @days int=9999 as
declare @msg
varchar(255)
select @msg=upper(db_name()) + ‘ objects changed in the last ‘ +

convert(varchar(30),@days) + ‘ days’
print @msg
select
@msg=replicate(‘=’,datalength(@msg))
print @msg
print ‘ ‘
select
Name=name,
Created=crdate,
Type=
case
when type=’C’ then ‘CHECK
constraint’ when type=’D’ then ‘Default
or DEFAULT constraint’ when type=’F’
then ‘FOREIGN KEY constraint’
when type=’K’ then ‘PRIMARY KEY or UNIQUE
constraint’ when
type=’L’ then ‘Log’ when type=’P’ then ‘Stored procedure’
when
type=’R’ then ‘Rule’ when type=’RF’ then ‘Stored procedure for

replication’ when type=’S’ then ‘System table’ when type=’TR’ then

‘Trigger’ when type=’U’ then ‘User table’ when type=’V’ then
‘View’ else
type
end
from sysobjects
where datediff(dd,crdate,getdate()) < @days
order by crdate desc
print ‘ ‘

Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.