dbo.QBM_PGUIDReplaceCustomizerFill
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_FCVElementToObjectKey2 source text reference
- references source dbo.QBM_FGISessionErrorRethrow source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
Complete Source
1CREATE PROCEDURE QBM_PGUIDReplaceCustomizerFill2AS3BEGIN4 DECLARE @uid_customizer varchar(38)5 DECLARE @XUser nvarchar(64) = object_name(@@procid)6 DECLARE @Xdate datetime = getutcdate()7 SET XACT_ABORT OFF8 BEGIN TRY9 SELECT TOP 1 @uid_customizer = m.UID_Customizer10 FROM DialogCustomizer m11 JOIN QBMClrType ct12 ON m.UID_QBMClrType = ct.UID_QBMClrType13 WHERE14 ct.FullTypeName = 'VI.Common.Customizer.ModuleGuids'15 INSERT INTO DialogTableHasCustomizer(UID_DialogTable,16 UID_Customizer,17 XObjectKey,18 XDateInserted,19 XDateUpdated,20 XUserInserted,21 XUserUpdated)22 SELECT23 t.UID_DialogTable,24 @uid_customizer,25 dbo.QBM_FCVElementToObjectKey2('DialogTableHasCustomizer',26 'UID_DialogTable',27 t.UID_DialogTable,28 'UID_Customizer',29 @uid_customizer),30 @Xdate,31 @Xdate,32 @XUser,33 @XUser34 FROM DialogTable t35 WITH(readpast)36 WHERE37 t.IsModuleGUIDAllowed = 1 AND NOT EXISTS(38 SELECT TOP 1 139 FROM DialogTableHasCustomizer h40 WHERE41 h.UID_DialogTable = t.UID_DialogTable AND h.UID_Customizer = @uid_customizer)42 DELETE DialogTableHasCustomizer43 FROM DialogTableHasCustomizer h44 LEFT45 OUTER46 JOIN DialogTable t47 WITH(readpast)48 ON h.UID_DialogTable = t.UID_DialogTable AND t.IsModuleGUIDAllowed = 149 WHERE50 h.UID_Customizer = @uid_customizer AND t.UID_DialogTable IS NULL51 END TRY52 BEGIN CATCH53 EXEC QBM_PSessionErrorAdd DEFAULT54 DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()55 RAISERROR(@Rethrow,56 18,57 1)58 WITH NOWAIT59 END CATCH60 endLabel:61 RETURN62END
Open raw exported source
1 create procedure QBM_PGUIDReplaceCustomizerFill as begin declare @uid_customizer varchar(38) declare @XUser nvarchar(64) = object_name(@@procid2) declare @Xdate datetime = getutcdate() SET XACT_ABORT OFF BEGIN TRY select top 1 @uid_customizer = m.UID_Customizer from DialogCustomizer m join QBMClrType3 ct on m.UID_QBMClrType = ct.UID_QBMClrType where ct.FullTypeName = 'VI.Common.Customizer.ModuleGuids' insert into DialogTableHasCustomizer(UID_DialogTable4, UID_Customizer, XObjectKey , XDateInserted, XDateUpdated, XUserInserted,XUserUpdated) select t.UID_DialogTable, @uid_customizer, dbo.QBM_FCVElementToObjectKey25 ('DialogTableHasCustomizer', 'UID_DialogTable', t.UID_DialogTable, 'UID_Customizer', @uid_customizer) , @Xdate, @Xdate, @XUser, @XUser from DialogTable6 t with (readpast) where t.IsModuleGUIDAllowed = 1 and not exists (Select top 1 1 from DialogTableHasCustomizer h where h.UID_DialogTable = t.UID_DialogTable7 and h.UID_Customizer = @uid_customizer ) delete DialogTableHasCustomizer from DialogTableHasCustomizer h left outer join DialogTable t with (readpast8) on h.UID_DialogTable = t.UID_DialogTable and t.IsModuleGUIDAllowed = 1 where h.UID_Customizer = @uid_customizer and t.UID_DialogTable is null END TRY9 BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT10 END CATCH endLabel: return end 11