我对 SQL Server 很陌生。我有一个问题,我们有一个名为的存储过程sys.sp_MSallocate_new_identity_range
(请参阅下面的部分逻辑)。它引用了两个我都找不到的函数。
if (**sys.fn_MSmerge_isrepublisher**(@artid)=0)
begin
declare @publisher_max_used numeric(38,0)
declare @pubid uniqueidentifier
declare @pub_ranges_needed tinyint
declare @pub_refresh_constraint bit
select @pubid = subid, @publisher_max_used = max_used from dbo.MSmerge_identity_range
where artid = @artid and is_pub_range = 1 and (**sys.fn_MSmerge_islocalpubid**(subid)=1)
if @pubid is NULL
begin
raiserror(20663, 16, -1)
return 1
end
使用适当的参数运行存储的过程 - 返回结果:
declare @p4 smallint
set @p4=2
declare @p5 numeric(38,0)
set @p5=31001
declare @p6 numeric(38,0)
set @p6=32001
declare @p7 numeric(38,0)
set @p7=32001
declare @p8 numeric(38,0)
set @p8=33001
exec sys.sp_MSallocate_new_identity_range 'B551D87F-5457-2102-9E6A-DD4EB44B1DD1','4EB5E2D0-3FC1-4D77-B894-5D57C433D0B2',2,@p4 output,@p5 output,@p6 output,@p7 output,@p8 output,N'dev_02',N'PPC04 - 21a535007fd8',N'My Documents\Assets\assets.sdf'
select @p4, @p5, @p6, @p7, @p8
即这有效并返回结果。一切都好 - 但我无法找到嵌入存储过程中的函数,即sys.fn_MSmerge_isrepublisher
或sys.fn_MSmerge_islocalpubid
.
我看过sys.objects
和sys.all_objects where name like '%fn_MSmerge%'
。
我设法跟踪 SQL,跟踪给出了 ObjectID,我可以看到语句正在执行。跟踪告诉我它是一个函数 - 20038 - FN - 并给了我一个 563464549 的 objectid - 但无法通过在 sys.objects 中查找数据库
任何帮助/建议都欣然接受。