dbo.QER_FGIITShopFlagCombineValid
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_FCVObjectkeyToElement source text reference
References
Referenced By
- dbo.ADS_TIADSAccountInADSGroup
- dbo.ADS_TIADSContactInADSGroup
- dbo.ADS_TIADSMachineInADSGroup
- dbo.ADS_TIBaseTreeHasADSGroup
- dbo.LDP_TIBaseTreeHasLDAPGroup
- dbo.LDP_TILDAPAccountInLDAPGroup
- dbo.LDP_TILDPMachineInLDAPGroup
- dbo.QER_TIBaseTreeHasQERAssign
- dbo.QER_TIBaseTreeHasQERResource
- dbo.QER_TIBaseTreeHasQERReuse
- dbo.QER_TIBaseTreeHasQERReuseUS
- dbo.QER_TIPersonHasQERAssign
- dbo.QER_TIPersonHasQERResource
- dbo.QER_TIPersonHasQERReuse
- dbo.QER_TIPersonHasQERReuseUS
- dbo.RMS_TIBaseTreeHasESet
- dbo.RMS_TIESetHasEntitlement
- dbo.RMS_TIPersonHasESet
- dbo.RMS_TIWorkDeskHasESet
- dbo.RPS_TIBaseTreeHasRPSReport
- dbo.RPS_TIPersonHasRPSReport
- dbo.TSB_TIBaseTreeHasTSBAccountDef
- dbo.TSB_TIBaseTreeHasUNSGroupB
- dbo.TSB_TIBaseTreeHasUNSGroupB1
- dbo.TSB_TIBaseTreeHasUNSGroupB2
- dbo.TSB_TIBaseTreeHasUNSGroupB3
- dbo.TSB_TIPersonHasTSBAccountDef
- dbo.TSB_TIUNSAccountBHasUNSGroupB
- dbo.TSB_TIUNSAccountBHasUNSGroupB1
- dbo.TSB_TIUNSAccountBHasUNSGroupB2
- dbo.TSB_TIUNSAccountBHasUNSGroupB3
- dbo.TSB_TIUNSAccountBInUNSGroupB
- dbo.TSB_TIUNSAccountBInUNSGroupB1
- dbo.TSB_TIUNSAccountBInUNSGroupB2
- dbo.TSB_TIUNSAccountBInUNSGroupB3
Complete Source
1CREATE FUNCTION dbo.QER_FGIITShopFlagCombineValid(2 @ObjectKeyDestination varchar(138),3 @DestinationIsForITShop BIT,4 @DestinationIsITShopOnly BIT,5 @ObjectKeyElement varchar(138),6 @ElementIsForITShop BIT,7 @ElementIsITShopOnly BIT8) RETURNS BIT9AS10BEGIN11 DECLARE @DestinationTable nvarchar(32)12 DECLARE @ElementTable nvarchar(32)13 DECLARE @msg nvarchar(1000)14 DECLARE @erg BIT = 115 SELECT16 @DestinationTable = dbo.QBM_FCVObjectkeyToElement('TableName',17 @ObjectKeyDestination)18 SELECT19 @ElementTable = dbo.QBM_FCVObjectkeyToElement('TableName',20 @ObjectKeyElement)21 IF @ElementIsForITShop IS NULL OR @ElementIsITShopOnly IS NULL22 BEGIN23 SELECT24 @msg = '#LDS#internal error, irregular null value @ElementIsForITShop.|'25 SELECT @erg = 026 RETURN(@erg)27 END28 IF @ElementIsForITShop = 0 AND @ElementIsITShopOnly = 129 BEGIN30 SELECT31 @msg = '#LDS#Invalid flag combination for IsForITShop and IsITShopOnly. in table {0}.|' + @ElementTable + '|'32 SELECT @erg = 033 RETURN(@erg)34 END35 IF @DestinationTable = 'ESet'36 BEGIN37 IF @DestinationIsForITShop = 0 AND @DestinationIsITShopOnly = 138 BEGIN39 SELECT40 @msg = '#LDS#Invalid flag combination for IsForITShop and IsITShopOnly. in table {0}.|' + @DestinationTable + '|'41 SELECT @erg = 042 RETURN(@erg)43 END44 IF @DestinationIsForITShop = 0 AND @DestinationIsITShopOnly = 045 BEGIN46 IF @ElementIsForITShop = 1 AND @ElementIsITShopOnly = 147 BEGIN48 SELECT49 @msg = '#LDS#Invalid combination of IT Shop flags from system roles and {0}.|' + @ElementTable + '|'50 SELECT @erg = 051 RETURN(@erg)52 END53 END54 IF @DestinationIsForITShop = 1 AND @DestinationIsITShopOnly = 055 BEGIN56 IF @ElementIsForITShop = 1 AND @ElementIsITShopOnly = 157 BEGIN58 SELECT59 @msg = '#LDS#Invalid combination of IT Shop flags from system roles and {0}.|' + @ElementTable + '|'60 SELECT @erg = 061 RETURN(@erg)62 END63 END64 IF @DestinationIsForITShop = 1 AND @DestinationIsITShopOnly = 165 BEGIN66 SELECT @msg = '#LDS#Nothing to test.|'67 RETURN(@erg)68 END69 END70 ELSE71 BEGIN72 IF @ElementIsForITShop = 073 BEGIN74 IF @DestinationTable IN('ITShopOrg',75 'ITShopSrc')76 BEGIN77 SELECT78 @msg = '#LDS#IT Shop tables are not allowed as assignment objects if IsForITShop = 0.|'79 SELECT @erg = 080 RETURN(@erg)81 END82 END83 IF @ElementIsForITShop = 1 AND @ElementIsITShopOnly = 084 BEGIN85 SELECT @msg = '#LDS#Nothing to test.|'86 RETURN(@erg)87 END88 IF @ElementIsForITShop = 1 AND @ElementIsITShopOnly = 189 BEGIN90 IF @DestinationTable NOT IN('ITShopOrg',91 'ITShopSrc',92 'MirrorShop')93 BEGIN94 SELECT95 @msg = '#LDS#Target of assignment {0} is not permitted with the combination of flags IsForITShop = 1 and IsITShopOnly = 1.|' + @DestinationTable96 + '|'97 SELECT @erg = 098 RETURN(@erg)99 END100 END101 END102 EndLabel:103 RETURN(@erg)104END
Open raw exported source
1 create function dbo.QER_FGIITShopFlagCombineValid ( @ObjectKeyDestination varchar(138) ,@DestinationIsForITShop bit , @DestinationIsITShopOnly2 bit , @ObjectKeyElement varchar(138) , @ElementIsForITShop bit , @ElementIsITShopOnly bit ) returns bit as begin declare @DestinationTable nvarchar3(32) declare @ElementTable nvarchar(32) declare @msg nvarchar(1000) declare @erg bit = 1 select @DestinationTable = dbo.QBM_FCVObjectkeyToElement('TableName'4, @ObjectKeyDestination) select @ElementTable = dbo.QBM_FCVObjectkeyToElement('TableName', @ObjectKeyElement) if @ElementIsForITShop is null or @ElementIsITShopOnly5 is null begin select @msg = '#LDS#internal error, irregular null value @ElementIsForITShop.|' select @erg = 0 return(@erg) end if @ElementIsForITShop6 = 0 and @ElementIsITShopOnly = 1 begin select @msg = '#LDS#Invalid flag combination for IsForITShop and IsITShopOnly. in table {0}.|' + @ElementTable 7+ '|' select @erg = 0 return(@erg) end if @DestinationTable = 'ESet' begin if @DestinationIsForITShop = 0 and @DestinationIsITShopOnly = 1 begin select8 @msg = '#LDS#Invalid flag combination for IsForITShop and IsITShopOnly. in table {0}.|' + @DestinationTable + '|' select @erg = 0 return(@erg) end if9 @DestinationIsForITShop = 0 and @DestinationIsITShopOnly = 0 begin if @ElementIsForITShop = 1 and @ElementIsITShopOnly = 1 begin select @msg = '#LDS#Invalid combination of IT Shop flags from system roles and {0}.|'10 + @ElementTable + '|' select @erg = 0 return(@erg) end end if @DestinationIsForITShop = 1 and @DestinationIsITShopOnly = 0 begin if @ElementIsForITShop11 = 1 and @ElementIsITShopOnly = 1 begin select @msg = '#LDS#Invalid combination of IT Shop flags from system roles and {0}.|' + @ElementTable + '|' select12 @erg = 0 return(@erg) end end if @DestinationIsForITShop = 1 and @DestinationIsITShopOnly = 1 begin select @msg = '#LDS#Nothing to test.|' return(@erg13) end end else begin if @ElementIsForITShop = 0 begin if @DestinationTable in ('ITShopOrg', 'ITShopSrc') begin select @msg = '#LDS#IT Shop tables are not allowed as assignment objects if IsForITShop = 0.|'14 select @erg = 0 return(@erg) end end if @ElementIsForITShop = 1 and @ElementIsITShopOnly = 0 begin select @msg = '#LDS#Nothing to test.|' return(@erg15) end if @ElementIsForITShop = 1 and @ElementIsITShopOnly = 1 begin if @DestinationTable not in ('ITShopOrg', 'ITShopSrc', 'MirrorShop') begin select16 @msg = '#LDS#Target of assignment {0} is not permitted with the combination of flags IsForITShop = 1 and IsITShopOnly = 1.|' + @DestinationTable + '|'17 select @erg = 0 return(@erg) end end end EndLabel: return (@erg) end 18