如何确定特定 Sql Server 2000 数据库中任何记录的最后更改时间?
我有一个很少更新的 SQL Server 2000 数据库实例。 我还有一个数据库表,其中没有保存每行的创建日期或修改日期的列。
有什么方法可以确定上次对整个数据库执行更新或插入的时间,以便我至少可以限制表中特定记录何时可能发生更改?
注意:我正在寻找有关已发生交易的信息。 如果我将来再次需要,触发器可能会对我们有所帮助,但并不能解决我试图描述的问题。
如果可以的话,我该怎么做呢?
I have a SQL Server 2000 database instance that is rarely updated. I also have a database table which has no columns holding each row's created date or modified date.
Is there any way that I can determine the last time an update or insert was performed on the database as a whole, so that I can at least put a bound on when the specific records in the table may have changed?
Note: I am looking for information about transactions that have already occurred. Triggers may help we should I require this again in the future, but does not address the problem I'm trying to describe.
If it can be done, how can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
数据库的日志文件可能包含一些对您的任务有用的信息。 AFAIK,数据库本身不存储“最后更新”日期。
The database's log file may have some information that is useful to your quest. AFAIK, the database itself doesn't store a "last updated" date.
根据数据库的大小和表的数量,您可以放置一个触发器来处理更新/或插入并将其记录到另一个表,可能会记录表名称和时间戳,它并不优雅,但可以工作。 并且不需要对数据库的其余部分进行任何修改。
Depending on the size of the database and the number of tables you could put a trigger in place that would handle updates/or inserts and log that to another table, potentially logging the table name and a timestamp, it isn't elegant but could work. and Doesn't require any modification to the rest of the db.