简体   繁体   English

我怎么知道我在SQL Server中使用插入触发器的最后日期?

[英]How can I know the last date I used insert trigger in SQL Server?

I need to get the last datetime I used a particular insert trigger only by system view etc. 我需要获取仅通过system view等使用特定insert trigger的最后datetime

Pay attention that the date modified of the table isn't correct answer for my question because it includes also table update dates. 请注意,表的修改日期不是我所提问题的正确答案,因为它还包括表更新日期。

If you think that I need to improve my question please leave comment for me 如果您认为我需要改善我的问题,请给我留言

Thank you 谢谢

This method is only reliable when you are in full recovery model and have log backups.. 仅当处于完全恢复模式并具有日志备份时,此方法才可靠。

select [Begin Time],    * 
from sys.fn_dblog(null,null) where 
AllocUnitName='yourtablename'

I don't think this is captured any where unless you have Auditing enabled. 我认为除非启用了审核,否则任何地方都不会捕获到此错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在插入时在SQL Server中创建触发器? - How can I create a trigger in SQL Server on insert? 如何在 SQL Server 上的触发器中编辑 INSERT 的值? - How can I edit values of an INSERT in a trigger on SQL Server? 我可以在SQL Server的INSTEAD OF INSERT触发器中放入INSERT吗? - Can I put an INSERT inside an INSTEAD OF INSERT trigger in SQL Server? 如何在SQL Server 2008中为insert_date和last_modified_date创建和设置字段? - How do I create and set fields for insert_date and last_modified_date in sql server 2008? 如何将音频插入SQL Server - How can I insert audio into SQL Server 插入触发器后的 if 语句对 SQL 服务器的性能有影响吗? if 语句如何用于值验证? - Does if statement in after insert trigger matters for the performance in SQL Server? How if statement can be used for value validation? 如何在 SQL Server 2008 中找到存储过程的最后修改日期、修改用户? - How can I find the last modified date, modified user of an stored procedure in SQL Server 2008? 如何知道SQL Server 2008中存储过程的最后更改日期? - How know the last change date of a Stored Procedure in SQL Server 2008? 如何将时间戳(当前日期和当前时间)插入 Microsoft SQL 服务器表的日期时间字段? - How can I insert the TimeStamp (current date and current time) into a datetime field of a Microsoft SQL server table? 如何在sql中提取最后一个聚合日期的值 - How can I extract the values of the last aggregation date in sql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM