dbo.QBM_PSingleUserBreak
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_FGISessionErrorRethrow source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
Referenced By
- No direct source references extracted.
Complete Source
1CREATE PROCEDURE QBM_PSingleUserBreak(2 @RequestingProcessID int = 03)4AS5BEGIN6 DECLARE @Erg int = 17 DECLARE @SingleUserProcess int8 DECLARE @SingleUserStart datetime9 DECLARE @XUser nvarchar(64) = object_name(@@procid)10 DECLARE @Xdate datetime = getutcdate()11 SET XACT_ABORT OFF12 BEGIN TRY13 IF NOT EXISTS(14 SELECT TOP 1 115 FROM sys.tables t16 WHERE17 t.name = 'DialogDatabase')18 BEGIN19 GOTO endLabel20 END21 SELECT22 TOP 1 @SingleUserProcess = SingleUserProcess,23 @SingleUserStart = SingleUserStart24 FROM DialogDatabase25 WHERE26 IsMainDatabase = 127 IF @SingleUserProcess IS NULL28 BEGIN29 SELECT @SingleUserProcess = 030 END31 IF @RequestingProcessID = 032 BEGIN33 SELECT @RequestingProcessID = @@SPID34 END35 IF @SingleUserProcess <> @RequestingProcessID36 BEGIN37 UPDATE DialogDatabase38 SET SingleUserProcess = @RequestingProcessID,39 SingleUserStart = GETUTCDATE(),40 XDateUpdated = @Xdate,41 XUserUpdated = @XUser42 WHERE43 IsMainDatabase = 144 END45 ELSE46 BEGIN47 SELECT @erg = 048 END49 END TRY50 BEGIN CATCH51 EXEC QBM_PSessionErrorAdd DEFAULT52 DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()53 RAISERROR(@Rethrow,54 18,55 1)56 WITH NOWAIT57 END CATCH58 endLabel:59 RETURN(@erg)60END
Open raw exported source
1 create procedure QBM_PSingleUserBreak (@RequestingProcessID int = 0 ) as begin declare @Erg int = 1 declare @SingleUserProcess int declare 2@SingleUserStart datetime declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() SET XACT_ABORT OFF BEGIN TRY if not3 exists (select top 1 1 from sys.tables t where t.name = 'DialogDatabase' ) begin goto endLabel end select top 1 @SingleUserProcess = SingleUserProcess4 , @SingleUserStart = SingleUserStart from DialogDatabase where IsMainDatabase = 1 if @SingleUserProcess is null begin select @SingleUserProcess = 0 end5 if @RequestingProcessID = 0 begin select @RequestingProcessID = @@SPID end if @SingleUserProcess <> @RequestingProcessID begin update DialogDatabase 6set SingleUserProcess = @RequestingProcessID , SingleUserStart = GETUTCDATE() , XDateUpdated = @Xdate , XUserUpdated = @XUser where IsMainDatabase = 1 7end else begin select @erg = 0 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow8() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return (@erg) end 9