dbo.QBM_ZAuthentifierInitial
Stored ProcedureSQL_STORED_PROCEDURESandbox DB
Interpretation
- Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
Relations
- No extracted relations.
Typed Edges
- references source dbo.QBM_FGIDBOwner source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE QBM_ZAuthentifierInitial(2 @SlotNumber int,3 @dummy1 varchar(38),4 @dummy2 varchar(38),5 @GenProcIDDummy varchar(38)6)7AS8BEGIN9 DECLARE @UID_DialogAuthentifier varchar(38) = NULL10 DECLARE @DebugSwitch int = 011 DECLARE @CountItems int12 DECLARE @XUser nvarchar(64) = object_name(@@procid)13 DECLARE @Xdate datetime = getutcdate()14 BEGIN TRY15 SELECT TOP 1 @UID_DialogAuthentifier = d.UID_DialogAuthentifier16 FROM DialogDatabase d17 WITH(readpast)18 WHERE19 d.IsMainDatabase = 1 AND d.UID_DialogAuthentifier > ' '20 IF @DebugSwitch > 021 BEGIN22 print 'in dialogdatabase ermittelt ' + isnull(@UID_DialogAuthentifier,23 '<null>')24 END25 IF @UID_DialogAuthentifier IS NULL OR @UID_DialogAuthentifier = 'QBM-740AF63FCA9D40E1A9A28CF076B36BBD'26 BEGIN27 UPDATE DialogAuthentifier28 SET IsEnabled = 1,29 ShowInInterface = 1,30 XDateUpdated = @Xdate,31 XUserUpdated = @XUser32 WHERE33 UID_DialogAuthentifier = 'QBM-740AF63FCA9D40E1A9A28CF076B36BBD' AND(IsEnabled = 0 OR ShowInInterface = 0)34 SELECT @CountItems = @@ROWCOUNT35 IF @DebugSwitch > 036 BEGIN37 print 'Eigenschaften DialogUser Authentifier geändert ' + str(@CountItems)38 END39 END40 IF @UID_DialogAuthentifier > ' '41 BEGIN42 IF NOT EXISTS(43 SELECT TOP 1 144 FROM DialogAuthentifier a45 WHERE46 a.UID_DialogAuthentifier = @UID_DialogAuthentifier AND a.IsEnabled = 1 AND a.ShowInInterface = 1)47 BEGIN48 SELECT @UID_DialogAuthentifier = NULL49 END50 END51 IF @DebugSwitch > 052 BEGIN53 print 'NachEigenschaften test ' + isnull(@UID_DialogAuthentifier,54 '<null>')55 END56 IF dbo.QBM_FGIDBOwner() <> 'CCC'57 BEGIN58 SELECT TOP 1 @UID_DialogAuthentifier = a.UID_DialogAuthentifier59 FROM DialogAuthentifier a60 WHERE61 a.UID_DialogAuthentifier LIKE 'MDK-%' AND a.IsEnabled = 1 AND a.ShowInInterface = 162 END63 IF @UID_DialogAuthentifier IS NULL64 BEGIN65 SELECT TOP 1 @UID_DialogAuthentifier = a.UID_DialogAuthentifier66 FROM DialogAuthentifier a67 JOIN QBMModuleDef m68 ON69 LEFT(a.UID_DialogAuthentifier,70 3) = m.ModuleName71 WHERE72 IsEnabled = 1 AND ShowInInterface = 173 ORDER BY m.SortOrder DESC,74 a.SortOrder ASC,75 a.ShowInInterface DESC76 END77 IF @DebugSwitch > 078 BEGIN79 print 'Nach Suche mit Interface ' + isnull(@UID_DialogAuthentifier,80 '<null>')81 END82 IF @UID_DialogAuthentifier IS NULL83 BEGIN84 SELECT TOP 1 @UID_DialogAuthentifier = a.UID_DialogAuthentifier85 FROM DialogAuthentifier a86 JOIN QBMModuleDef m87 ON88 LEFT(a.UID_DialogAuthentifier,89 3) = m.ModuleName90 WHERE91 IsEnabled = 192 ORDER BY m.SortOrder DESC,93 a.SortOrder ASC,94 a.ShowInInterface DESC95 END96 IF @DebugSwitch > 097 BEGIN98 print 'Nach Suche ohne Interface ' + isnull(@UID_DialogAuthentifier,99 '<null>')100 END101 UPDATE dialogdatabase102 SET UID_DialogAuthentifier = @UID_DialogAuthentifier,103 XDateUpdated = @Xdate,104 XUserUpdated = @XUser105 WHERE106 ismaindatabase = 1 AND isnull(UID_DialogAuthentifier,107 '') <> isnull(@UID_DialogAuthentifier,108 '')109 END TRY110 BEGIN CATCH111 EXEC QBM_PSessionErrorAdd DEFAULT112 RAISERROR('',113 18,114 1)115 WITH NOWAIT116 END CATCH117END
Open raw exported source
1 create procedure QBM_ZAuthentifierInitial ( @SlotNumber int , @dummy1 varchar(38) , @dummy2 varchar(38) , @GenProcIDDummy varchar(38) ) as2 begin declare @UID_DialogAuthentifier varchar(38) = null declare @DebugSwitch int = 0 declare @CountItems int declare @XUser nvarchar(64) = object_name3(@@procid) declare @Xdate datetime = getutcdate() BEGIN TRY select top 1 @UID_DialogAuthentifier = d.UID_DialogAuthentifier from DialogDatabase d with 4(readpast) where d.IsMainDatabase = 1 and d.UID_DialogAuthentifier > ' ' if @DebugSwitch > 0 begin print 'in dialogdatabase ermittelt ' + isnull(@UID_DialogAuthentifier5, '<null>') end if @UID_DialogAuthentifier is null or @UID_DialogAuthentifier = 'QBM-740AF63FCA9D40E1A9A28CF076B36BBD' begin update DialogAuthentifier6 set IsEnabled = 1 , ShowInInterface = 1 , XDateUpdated = @Xdate , XUserUpdated = @XUser where UID_DialogAuthentifier = 'QBM-740AF63FCA9D40E1A9A28CF076B36BBD'7 and ( IsEnabled = 0 or ShowInInterface = 0 ) select @CountItems = @@ROWCOUNT if @DebugSwitch > 0 begin print 'Eigenschaften DialogUser Authentifier geändert '8+ str(@CountItems) end end if @UID_DialogAuthentifier > ' ' begin if not exists (select top 1 1 from DialogAuthentifier a where a.UID_DialogAuthentifier9 = @UID_DialogAuthentifier and a.IsEnabled = 1 and a.ShowInInterface = 1 ) begin select @UID_DialogAuthentifier = null end end if @DebugSwitch > 0 begin10 print 'NachEigenschaften test ' + isnull(@UID_DialogAuthentifier, '<null>') end if dbo.QBM_FGIDBOwner() <> 'CCC' begin select top 1 @UID_DialogAuthentifier11 = a.UID_DialogAuthentifier from DialogAuthentifier a where a.UID_DialogAuthentifier like 'MDK-%' and a.IsEnabled = 1 and a.ShowInInterface = 1 end if 12@UID_DialogAuthentifier is null begin select top 1 @UID_DialogAuthentifier = a.UID_DialogAuthentifier from DialogAuthentifier a join QBMModuleDef m on 13left(a.UID_DialogAuthentifier, 3) = m.ModuleName where IsEnabled = 1 and ShowInInterface = 1 order by m.SortOrder desc, a.SortOrder asc, a.ShowInInterface14 desc end if @DebugSwitch > 0 begin print 'Nach Suche mit Interface ' + isnull(@UID_DialogAuthentifier, '<null>') end if @UID_DialogAuthentifier is null15 begin select top 1 @UID_DialogAuthentifier = a.UID_DialogAuthentifier from DialogAuthentifier a join QBMModuleDef m on left(a.UID_DialogAuthentifier, 163) = m.ModuleName where IsEnabled = 1 order by m.SortOrder desc, a.SortOrder asc, a.ShowInInterface desc end if @DebugSwitch > 0 begin print 'Nach Suche ohne Interface '17 + isnull(@UID_DialogAuthentifier, '<null>') end update dialogdatabase set UID_DialogAuthentifier = @UID_DialogAuthentifier , XDateUpdated = @Xdate , 18XUserUpdated = @XUser where ismaindatabase = 1 and isnull(UID_DialogAuthentifier, '') <> isnull(@UID_DialogAuthentifier, '') END TRY BEGIN CATCH exec QBM_PSessionErrorAdd19 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH end 20