SQL Server 获取某时间点后修改的函数Function 并以文本格式显示

修改查询分析器如下选项

右键=》查询选项 =》结果=》文本=》 取消 在结果集中包括列标题 的勾选

右键=》将结果保存到=》 选择 以文本格式显示结果

执行如下SQL

declare @funcname nvarchar(100)=N'';
declare curFunc cursor for
select 
 [name]
 --,create_date
 --,modify_date 
FROM 
 sys.all_objects 
where 
 type_desc LIKE '%FUNCTION%'
 and substring([name],1,3) not in ('dm_','fn_')
 and modify_date >='2013-07-11 00:00:00'
order by 
 modify_date desc;

open curFunc;
fetch next from curFunc into @funcname;
while @@FETCH_STATUS = 0 
begin
 print(N'IF EXISTS(SELECT 1 FROM SYS.OBJECTS WHERE [NAME]=N''' + @funcname +''' AND [TYPE]=''FN'')')
 PRINT(N'DROP FUNCTION ' + @funcname);
 print N'GO';
 exec ('sp_helptext ' + @funcname);
 print N'GO';
 fetch next from curFunc into @funcname;
end
close curFunc;
deallocate curFunc;

  

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值