在 SQL Server 数据库中查找最近的对象更改 [英] Find recent object changes in SQL Server Database
本文介绍了在 SQL Server 数据库中查找最近的对象更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我添加和修改几个(新的和现有的)表格和存储过程,对于特定数据库和服务器,过去 3 个月.
I've added and modified several (new and existing resp.) tables and stored procs, for a particular database and server, in last 3 months.
我在想是否有任何 SQL 查询可以确定所有这些更改.
I was thinking if there's any SQL query by which I can determine all those changes.
谢谢.
推荐答案
查询sys.objects
表,找到改变的对象,按modify_date
和过滤>类型代码>;U = 用户表,P = 存储过程.
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.
这篇关于在 SQL Server 数据库中查找最近的对象更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文