我想修改SQL中任何存储过程的历史记录 [英] I want modified History of any stored Procedure in SQL

查看:296
本文介绍了我想修改SQL中任何存储过程的历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,







我在SQL中有一个存储过程。有人修改了它。我想要历史记录何时以及谁修改过它(PC-Name,IPAddress)

HI everyone,



I have a stored Procedure in SQL. Someone has modified it. I want history when and who has modified it(PC-Name,IPAddress)

推荐答案

您可以尝试类似
SELECT *
FROM   sys.traces t
       CROSS APPLY fn_trace_gettable(REVERSE(SUBSTRING(REVERSE(t.path),
                                                       CHARINDEX('\', REVERSE(t.path)), 
                                                       260)
                                             ) + N'log.trc', DEFAULT) f
WHERE  t.is_default = 1
       AND ObjectName = 'YourSPName'
       AND EventClass IN (46,47,164)  /*I.e. Created, Dropped or Altered



进一步阅读这篇文章 [ ^ ]



如果你不喜欢我不想要你可以使用的人和地点


Further reading on this post[^]

If you don't want the who and where you can use

SELECT name, create_date, modify_date 
FROM sys.objects
WHERE type = 'P' and [name] = 'YourSPName'


这篇关于我想修改SQL中任何存储过程的历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆