上次修改日期对象
如何找出 MS SQL Server 2000 对象的最后修改日期?
我需要获取自 8 月 15 日以来修改的所有视图、过程、函数等的列表。 在 sysObjects 中,我可以看到对象的创建日期,但我需要知道它们上次更改的时间。
注意:这是一个 SQL 2000 数据库。
How can I find out the date a MS SQL Server 2000 object was last modified?
I need to get a list of all the views, procs, functions etc that were modified since Aug 15th. In sysObjects I can see the date objects were created but I need to know when they were last altered.
NB: this is an SQL 2000 database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道这有点旧,但是可以使用此查询查看存储的过程和函数的最后更改日期:
只是认为提及这一点会很好,因为我搜索了这个解决方案这条线索具有误导性。
I know this is a bit old, but it is possible to view the last altered date of stored procs and functions with this query:
Just thought it would be nice to mention this since I searched for this very solution and this thread was misleading.
我已通过以下查询得到上述任何过程修改日期历史记录的确认答案
上执行该过程
步骤 -1 在数据库步骤 -2
然后将文本复制到 Excel,并带有标题
选择路径列,然后将确切的过程名称粘贴到 ^F 窗口中,然后按 Enter
您将获得准确的修改日期。
问候,
苏迪尔
浦那
I have got confirmed Answer for above any procedure History for modified date with below query
Step -1 Execute the procedure on DB
Step -2
Then copy the text to Excel with headers
select route coloumn and then paste the exact procedure name into ^F window and press enter
you will get exact modified date.
Regards,
Sudhir
Pune
请注意,SQL Server 实际上不记录最后修改日期。 它不存在于任何系统表中。
架构更改历史记录报告实际上是根据默认跟踪构建的。 由于许多管理员(和网络主机)将其关闭,因此它可能不适合您。
Buck Woody 很好地解释了此报告的工作原理 此处。 数据也是临时的。
因此,您永远不应该依赖架构更改历史记录报告。 替代方案:
--
编辑:看到这是 SQL 2000。这排除了默认跟踪和 DDL 触发器。 您只剩下我上面列出的更乏味的选项之一。
Note that SQL Server actually does not record the last modification date. It does not exist in any system tables.
The Schema Changes History report is actually constructed from the Default Trace. Since many admins (and web hosts) turn that off, it may not work for you.
Buck Woody had a good explanation of how this report works here. The data is also temporary.
For this reason, you should never RELY on the Schema Changes History report. Alternatives:
--
Edit: saw that this is SQL 2000. That rules out Default Trace and DDL Triggers. You're left with one of the more tedious options I listed above.
这并不总是正确的,因为修改日期是上次使用 ALTER 语句修改对象的日期。 如果对象是表或视图,则在创建或更改表或视图上的聚集索引时,modify_date 也会更改。
This is not always correct because modify_date is Date the object was last modified by using an ALTER statement. If the object is a table or a view, modify_date also changes when a clustered index on the table or view is created or altered.