dbo.DPR_FGIProjectionRootRunning
Scalar FunctionSQL_SCALAR_FUNCTIONSandbox DB
Interpretation
- Database function. Usually supports views, validation, or calculated predicates; look at referenced-by entries for callers.
Relations
- No extracted relations.
Typed Edges
- references source dbo.QBM_FCVStringToInt source text reference
- references source dbo.QBM_FGIConfigparmValue source text reference
- references source dbo.QBM_FGIUTCDate source text reference
References
Referenced By
- dbo.ADS_RAccountInADSGroup
- dbo.ADS_RADSMachineInADSGroup
- dbo.ADS_RContactInADSGroup
- dbo.ADS_RGroupInADSGroup
- dbo.ADS_ZAccountInADSGroup
- dbo.ADS_ZADSMachineInADSGroup
- dbo.ADS_ZContactInADSGroup
- dbo.LDP_RAccountInLDAPGroup
- dbo.LDP_RLDPMachineInLDAPGroup
- dbo.LDP_ZAccountInLDAPGroup
- dbo.LDP_ZLDPMachineInLDAPGroup
- dbo.TSB_RUNSAccountBHasUNSItemB
- dbo.TSB_RUNSAccountBInUNSGroupB
- dbo.TSB_RUNSAccountBInUNSGroupB1
- dbo.TSB_RUNSAccountBInUNSGroupB2
- dbo.TSB_RUNSAccountBInUNSGroupB3
- dbo.TSB_RUNSGroupB1InUNSGroupB1
- dbo.TSB_RUNSGroupB2InUNSGroupB2
- dbo.TSB_RUNSGroupB3InUNSGroupB3
- dbo.TSB_RUNSGroupBHasUNSItemB
- dbo.TSB_RUNSGroupBInUNSGroupB
Complete Source
1CREATE FUNCTION dbo.DPR_FGIProjectionRootRunning(2 @BaseTableName varchar(30)3) RETURNS BIT4AS5BEGIN6 DECLARE @erg BIT = 07 DECLARE @MaxFSDuration int8 DECLARE @MaxFSDurationDefault int = 7209 DECLARE @Fullpath nvarchar(1000) = NULL10 DECLARE @RunningSyncs QBM_YParameterList11 SELECT12 TOP 1 @Fullpath = cp.FullPath,13 @MaxFSDuration = dbo.QBM_FCVStringToInt(14 RIGHT(dbo.QBM_FGIConfigparmValue(cp.FullPath), 6),15 @MaxFSDurationDefault)16 FROM DialogTable t17 JOIN DialogConfigParm cp18 ON19 LEFT(t.UID_DialogTable,20 3) =21 LEFT(cp.UID_ConfigParm,22 3)23 WHERE24 t.TableName = @BaseTableName AND cp.FullPath LIKE 'TargetSystem\%\MaxFullsyncDuration'25 IF isnull(@Fullpath,26 '') = ''27 BEGIN28 SELECT @MaxFSDuration = @MaxFSDurationDefault29 END30 IF @MaxFSDuration > 1008031 BEGIN32 SELECT @MaxFSDuration = 1008033 END34 INSERT INTO @RunningSyncs(Parameter1)35 SELECT36 DISTINCT si.XObjectKey37 FROM DPRRootObjConnectionInfo ci38 WITH(readpast)39 JOIN DPRProjectionStartInfo si40 WITH(readpast)41 ON ci.UID_DPRRootObjConnectionInfo = si.UID_DPRRootObjConnectionInfo42 WHERE43 ci.ObjectKeyRoot LIKE '<Key><T>' + @BaseTableName + '</T>%' AND(EXISTS(44 SELECT TOP 1 145 FROM DPRProjectionConfigStep cs46 WHERE47 cs.UID_DPRProjectionConfig = si.UID_DPRProjectionConfig AND cs.UID_LeftDPRSystemConnection = ci.UID_DPRSystemConnection) OR EXISTS(48 SELECT TOP 1 149 FROM DPRProjectionConfigStep cs50 WHERE51 cs.UID_DPRProjectionConfig = si.UID_DPRProjectionConfig AND cs.UID_RightDPRSystemConnection = ci.UID_DPRSystemConnection)) AND dateadd(mi52 ,53 @MaxFSDuration,54 isnull(si.LastStart, '1899-12-30')) > dbo.QBM_FGIUTCDate()55 IF @@ROWCOUNT > 056 BEGIN57 IF EXISTS(58 SELECT TOP 1 159 FROM JobQueue Q60 WITH(readpast)61 JOIN @RunningSyncs I62 ON Q.BasisObjectKey = I.Parameter1 AND q.JobChainName = 'DPR_DPRProjectionStartInfo_Run_Synchronization' AND Q.Ready2EXE IN(N 'TRUE',63 N 'LOADED', N 'PROCESSING'))64 BEGIN65 SELECT @erg = 166 END67 END68 endLabel:69 RETURN(@erg)70END
Open raw exported source
1 create function dbo.DPR_FGIProjectionRootRunning ( @BaseTableName varchar(30) ) returns bit AS begin declare @erg bit = 0 declare @MaxFSDuration2 int declare @MaxFSDurationDefault int = 720 declare @Fullpath nvarchar(1000) = null declare @RunningSyncs QBM_YParameterList select top 1 @Fullpath =3 cp.FullPath , @MaxFSDuration = dbo.QBM_FCVStringToInt(right(dbo.QBM_FGIConfigparmValue(cp.FullPath),6), @MaxFSDurationDefault) from DialogTable t join4 DialogConfigParm cp on LEFT(t.UID_DialogTable, 3) = LEFT(cp.UID_ConfigParm, 3) where t.TableName = @BaseTableName and cp.FullPath like 'TargetSystem\%\MaxFullsyncDuration'5 if isnull(@Fullpath, '') = '' begin select @MaxFSDuration = @MaxFSDurationDefault end if @MaxFSDuration > 10080 begin select @MaxFSDuration = 10080 end6 insert into @RunningSyncs (Parameter1) select distinct si.XObjectKey from DPRRootObjConnectionInfo ci with (readpast) join DPRProjectionStartInfo si 7with (readpast) on ci.UID_DPRRootObjConnectionInfo = si.UID_DPRRootObjConnectionInfo where ci.ObjectKeyRoot like '<Key><T>' + @BaseTableName + '</T>%' 8and (exists ( select top 1 1 from DPRProjectionConfigStep cs where cs.UID_DPRProjectionConfig = si.UID_DPRProjectionConfig and cs.UID_LeftDPRSystemConnection9 = ci.UID_DPRSystemConnection ) or exists ( select top 1 1 from DPRProjectionConfigStep cs where cs.UID_DPRProjectionConfig = si.UID_DPRProjectionConfig10 and cs.UID_RightDPRSystemConnection = ci.UID_DPRSystemConnection ) ) and dateadd(mi, @MaxFSDuration, isnull(si.LastStart , '1899-12-30')) > dbo.QBM_FGIUTCDate11() if @@ROWCOUNT > 0 begin if exists ( select top 1 1 from JobQueue Q with (readpast) join @RunningSyncs I on Q.BasisObjectKey = I.Parameter1 and q.JobChainName12 = 'DPR_DPRProjectionStartInfo_Run_Synchronization' and Q.Ready2EXE in (N'TRUE', N'LOADED', N'PROCESSING') ) begin select @erg = 1 end end endLabel: return13 (@erg) end 14