I've added and modified several (new and existing resp.) tables and stored procs, for a particular database and server, in last 3 months.
I was thinking if there's any SQL query by which I can determine all those changes.
Thanks.
Query the sys. objects table to find the objects that changed and filter by modify_date and type ; U = User table, P = Stored procedure. This approach will tell you what objects have changed, but not the specific changes.
To get the last updated record in SQL Server: We can write trigger (which automatically fires) i.e. whenever there is a change (update) that occurs on a row, the “lastupdatedby” column value should get updated by the current timestamp.
The name of the report is Schema Changes History. To run the Schema Changes History report open SQL Server Management Studio, make a right click on an object (the instance name or a database name, for example), then select "Reports", click on "Standard Reports", and then click on "Schema Changes History" report.
To track changes, change tracking must first be enabled for the database and then enabled for the tables that you want to track within that database. The table definition does not have to be changed in any way, and no triggers are created.
Query the sys.objects
table to find the objects that changed and filter by modify_date
and type
; U = User table, P = Stored procedure.
select *
from sys.objects
where (type = 'U' or type = 'P')
and modify_date > dateadd(m, -3, getdate())
This approach will tell you what objects have changed, but not the specific changes.
Hi you can get the changed/modified db object details with this query
select name,create_date,modify_date
from sys.procedures
order by modify_date desc
Thanks
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