dbo.TSB_FGIDPRNameSpaceFromRoot
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
- No typed edges extracted for this source.
References
- No direct source references extracted.
Referenced By
- No direct source references extracted.
Complete Source
1CREATE FUNCTION dbo.TSB_FGIDPRNameSpaceFromRoot(2 @UID_Anchor varchar(38),3 @TableName varchar(30)4) RETURNS varchar(385)6 WITH schemabinding7AS8BEGIN9 DECLARE @erg varchar(38)10 IF @TableName = 'UnsAccountB'11 BEGIN12 SELECT TOP 1 @erg = y.UID_DPRNameSpace13 FROM dbo.UNSAccountB x14 JOIN dbo.UNSRootB y15 ON x.UID_UNSRootB = y.UID_UNSRootB16 WHERE17 x.UID_UNSAccountB = @UID_Anchor18 RETURN(@erg)19 END20 IF @TableName = 'UnsRootB'21 BEGIN22 SELECT TOP 1 @erg = y.UID_DPRNameSpace23 FROM dbo.UNSRootB y24 WHERE25 y.UID_UNSRootB = @UID_Anchor26 RETURN(@erg)27 END28 IF @TableName = 'UNSContainerB'29 BEGIN30 SELECT TOP 1 @erg = y.UID_DPRNameSpace31 FROM dbo.UNSContainerB x32 JOIN dbo.UNSRootB y33 ON x.UID_UNSRootB = y.UID_UNSRootB34 WHERE35 x.UID_UNSContainerB = @UID_Anchor36 RETURN(@erg)37 END38 IF @TableName = 'UNSGroupB'39 BEGIN40 SELECT TOP 1 @erg = y.UID_DPRNameSpace41 FROM dbo.UNSGroupB x42 JOIN dbo.UNSRootB y43 ON x.UID_UNSRootB = y.UID_UNSRootB44 WHERE45 x.UID_UNSGroupB = @UID_Anchor46 RETURN(@erg)47 END48 IF @TableName = 'UNSGroupB1'49 BEGIN50 SELECT TOP 1 @erg = y.UID_DPRNameSpace51 FROM dbo.UNSGroupB1 x52 JOIN dbo.UNSRootB y53 ON x.UID_UNSRootB = y.UID_UNSRootB54 WHERE55 x.UID_UNSGroupB1 = @UID_Anchor56 RETURN(@erg)57 END58 IF @TableName = 'UNSGroupB2'59 BEGIN60 SELECT TOP 1 @erg = y.UID_DPRNameSpace61 FROM dbo.UNSGroupB2 x62 JOIN dbo.UNSRootB y63 ON x.UID_UNSRootB = y.UID_UNSRootB64 WHERE65 x.UID_UNSGroupB2 = @UID_Anchor66 RETURN(@erg)67 END68 IF @TableName = 'UNSGroupB3'69 BEGIN70 SELECT TOP 1 @erg = y.UID_DPRNameSpace71 FROM dbo.UNSGroupB3 x72 JOIN dbo.UNSRootB y73 ON x.UID_UNSRootB = y.UID_UNSRootB74 WHERE75 x.UID_UNSGroupB3 = @UID_Anchor76 RETURN(@erg)77 END78 IF @TableName = 'UNSItemB'79 BEGIN80 SELECT TOP 1 @erg = y.UID_DPRNameSpace81 FROM dbo.UNSItemB x82 JOIN dbo.UNSRootB y83 ON x.UID_UNSRootB = y.UID_UNSRootB84 WHERE85 x.UID_UNSItemB = @UID_Anchor86 RETURN(@erg)87 END88 endLabel:89 RETURN(@erg)90END
Open raw exported source
1 create function dbo.TSB_FGIDPRNameSpaceFromRoot(@UID_Anchor varchar(38) , @TableName varchar(30) ) returns varchar(38) with schemabinding as2 begin declare @erg varchar(38) if @TableName = 'UnsAccountB' begin select top 1 @erg = y.UID_DPRNameSpace from dbo.UNSAccountB x join dbo.UNSRootB y on3 x.UID_UNSRootB = y.UID_UNSRootB where x.UID_UNSAccountB = @UID_Anchor return(@erg) end if @TableName = 'UnsRootB' begin select top 1 @erg = y.UID_DPRNameSpace4 from dbo.UNSRootB y where y.UID_UNSRootB = @UID_Anchor return(@erg) end if @TableName = 'UNSContainerB' begin select top 1 @erg = y.UID_DPRNameSpace5 from dbo.UNSContainerB x join dbo.UNSRootB y on x.UID_UNSRootB = y.UID_UNSRootB where x.UID_UNSContainerB = @UID_Anchor return(@erg) end if @TableName6 = 'UNSGroupB' begin select top 1 @erg = y.UID_DPRNameSpace from dbo.UNSGroupB x join dbo.UNSRootB y on x.UID_UNSRootB = y.UID_UNSRootB where x.UID_UNSGroupB7 = @UID_Anchor return(@erg) end if @TableName = 'UNSGroupB1' begin select top 1 @erg = y.UID_DPRNameSpace from dbo.UNSGroupB1 x join dbo.UNSRootB y on8 x.UID_UNSRootB = y.UID_UNSRootB where x.UID_UNSGroupB1 = @UID_Anchor return(@erg) end if @TableName = 'UNSGroupB2' begin select top 1 @erg = y.UID_DPRNameSpace9 from dbo.UNSGroupB2 x join dbo.UNSRootB y on x.UID_UNSRootB = y.UID_UNSRootB where x.UID_UNSGroupB2 = @UID_Anchor return(@erg) end if @TableName = 'UNSGroupB3'10 begin select top 1 @erg = y.UID_DPRNameSpace from dbo.UNSGroupB3 x join dbo.UNSRootB y on x.UID_UNSRootB = y.UID_UNSRootB where x.UID_UNSGroupB3 = @UID_Anchor11 return(@erg) end if @TableName = 'UNSItemB' begin select top 1 @erg = y.UID_DPRNameSpace from dbo.UNSItemB x join dbo.UNSRootB y on x.UID_UNSRootB =12 y.UID_UNSRootB where x.UID_UNSItemB = @UID_Anchor return(@erg) end endLabel: return(@erg) end 13