永发信息网

SQL 存储过程或自定义函数调用另一个自定义函数查询问题

答案:2  悬赏:40  手机版
解决时间 2021-01-26 23:48
  • 提问者网友:原来太熟悉了会陌生
  • 2021-01-26 19:54
MSSQL使用中会经常调用已有的自定义函数,但是当被调用 的自定义函数参数有做修改时,引用的也会出问题,有什么方法能查出自定义函数被那些存储过程或自定义函数调用了?
最佳答案
  • 五星知识达人网友:逐風
  • 2021-01-26 21:12
不知道你什么库,给sqlserver的,,,
SELECt obj.Name 名称, sc.TEXT 内容  
FROM syscomments sc  
INNER JOIN sysobjects obj ON sc.Id = obj.ID  
WHERe sc.TEXT LIKE '%' + '函数名称' + '%' 
AND TYPE IN ('P','FN','IF','TF')type里面p是存储过程,其他f的是函数,可能函数会有遗漏,,你可以看看
全部回答
  • 1楼网友:duile
  • 2021-01-26 22:35
-- description: 根据输入的中继及区域,确定查询的数据 -- ============================================= alter procedure 中继话务量查询 --drop procedure 中继话务量查询 --create procedure 中继话务量查询 -- add the parameters for the stored procedure here @开始日期 datetime, @结束日期 datetime, @查询区域 int, @查询中继 int as begin -- set nocount on added to prevent extra result sets from -- interfering with select statements. set nocount on; -- insert statements for procedure here if @查询区域=99 begin if @查询中继=0 begin select exch_id, trk_in, date, total_dur, bill_num from trk_in_日汇总2007 where (date >= @开始日期) and (date <= @结束日期) end else begin select exch_id, trk_in, date, total_dur, bill_num from trk_in_日汇总2007 where (date >= @开始日期) and (trk_in =@查询中继 ) and (date <= @结束日期) end end else begin if @查询中继=0 begin select exch_id, trk_in, date, total_dur, bill_num from trk_in_日汇总2007 where (date >= @开始日期) and (date <= @结束日期) and (exch_id = @查询区域) end else begin select exch_id, trk_in, date, total_dur, bill_num from trk_in_日汇总2007 where (date >= @开始日期) and (trk_in =@查询中继 ) and (date <= @结束日期) and (exch_id = @查询区域) end end end go
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯