Back to OIM Explorer

dbo.DPR_FTProjectionRootRunning

Inline Table FunctionSQL_INLINE_TABLE_VALUED_FUNCTIONSandbox DB

Inline Table Function.

Source: sandbox-db sys.sql_modules

Source size: 1.404 characters

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

Complete Source

SQL43 lines
1CREATE FUNCTION dbo.DPR_FTProjectionRootRunning(2) RETURNS TABLE3AS4RETURN(5SELECT6  x.ObjectKeyRoot AS ObjectKeyRoot,7  x.BaseTableName AS BaseTableName8FROM(9SELECT10  ci.ObjectKeyRoot, t.TableName AS BaseTableName, t.UID_DialogTable, isnull(si.LastStart, '1899-12-30') AS LastStart11FROM DPRRootObjConnectionInfo ci12JOIN DPRProjectionStartInfo si13  WITH(nolock)14  ON ci.UID_DPRRootObjConnectionInfo = si.UID_DPRRootObjConnectionInfo15JOIN DialogTable t16  WITH(readpast)17  ON ci.ObjectKeyRoot LIKE '<Key><T>' + t.TableName + '</T>%'18WHERE19  (EXISTS(20SELECT TOP 1 121FROM DPRProjectionConfigStep cs22WHERE23  cs.UID_DPRProjectionConfig = si.UID_DPRProjectionConfig AND cs.UID_LeftDPRSystemConnection = ci.UID_DPRSystemConnection) OR EXISTS(24SELECT TOP 1 125FROM DPRProjectionConfigStep cs26WHERE27  cs.UID_DPRProjectionConfig = si.UID_DPRProjectionConfig AND cs.UID_RightDPRSystemConnection = ci.UID_DPRSystemConnection))) AS x28LEFT29OUTER30JOIN DialogConfigParm cp31  ON32LEFT(x.UID_DialogTable, 3) =33LEFT(cp.UID_ConfigParm, 3) AND cp.FullPath LIKE 'TargetSystem\%\MaxFullsyncDuration'34WHERE35  dateadd(mi, CASE36WHEN cp.UID_ConfigParm IS NULL THEN3772038WHEN dbo.QBM_FCVStringToInt(39RIGHT(dbo.QBM_FGIConfigparmValue(cp.FullPath), 6), 720) > 10080 THEN401008041ELSE dbo.QBM_FCVStringToInt(42RIGHT(dbo.QBM_FGIConfigparmValue(cp.FullPath), 6), 720)43END, isnull(x.LastStart, '1899-12-30')) > getutcdate())
Open raw exported source
SQL ยท Raw10 lines
1create function dbo.DPR_FTProjectionRootRunning ()      returns table as return (  select x.ObjectKeyRoot as ObjectKeyRoot , x.BaseTableName as BaseTableName2 from ( select ci.ObjectKeyRoot, t.TableName as BaseTableName, t.UID_DialogTable , isnull(si.LastStart , '1899-12-30') as LastStart from DPRRootObjConnectionInfo3 ci join DPRProjectionStartInfo si with (nolock) on ci.UID_DPRRootObjConnectionInfo = si.UID_DPRRootObjConnectionInfo join DialogTable t with (readpast4) on ci.ObjectKeyRoot like '<Key><T>' + t.TableName + '</T>%' where (exists ( select top 1 1 from DPRProjectionConfigStep cs where cs.UID_DPRProjectionConfig5 = si.UID_DPRProjectionConfig and cs.UID_LeftDPRSystemConnection = ci.UID_DPRSystemConnection ) or exists ( select top 1 1 from DPRProjectionConfigStep6 cs where cs.UID_DPRProjectionConfig = si.UID_DPRProjectionConfig and cs.UID_RightDPRSystemConnection = ci.UID_DPRSystemConnection ) ) ) as x   left outer7 join DialogConfigParm cp on LEFT(x.UID_DialogTable, 3) = LEFT(cp.UID_ConfigParm, 3) and cp.FullPath like 'TargetSystem\%\MaxFullsyncDuration' where dateadd8(mi , case when cp.UID_ConfigParm is null then 720  when dbo.QBM_FCVStringToInt(right(dbo.QBM_FGIConfigparmValue(cp.FullPath),6), 720 ) > 10080 then 100809 else dbo.QBM_FCVStringToInt(right(dbo.QBM_FGIConfigparmValue(cp.FullPath),6), 720 ) end , isnull(x.LastStart , '1899-12-30') ) > getutcdate() ) 10