dbo.QBM_PWriteDialogJournal
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:29.367 · modified 2026-04-14T23:20:26.060 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@MessageString | nvarchar | no |
@ApplicationName | nvarchar | no |
@LogonUser | nvarchar | no |
@MessageType | nchar | no |
@HostName | nvarchar | no |
@SuppressEntriesCount | int | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogJournal | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVStringToInt | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorForLog | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create procedure QBM_PWriteDialogJournal ( @MessageString nvarchar(max), @ApplicationName nvarchar(64) = N'', @LogonUser nvarchar(64) = N'' 2, @MessageType nchar(1) = N'I' , @HostName nvarchar(64) = N'' , @SuppressEntriesCount int = 0 ) as begin declare @messagetypeIntern nchar(1) declare @ApplicationNameIntern 3 nvarchar(64) declare @HostnameIntern nvarchar(64) declare @LogonUserIntern nvarchar(64) declare @LevelForLogging char(1) = 'T' declare @ProcID int declare 4 @Agentvgl varchar(64) = 'OneIM_DatabaseAgent' SET XACT_ABORT OFF BEGIN TRY If (XACT_STATE()) < 0 BEGIN goto endLabel END if @messagetype not in (N'W' 5, N'E', N'I', 'D', 'T') begin select @messagetypeIntern = N'T' end else begin select @messagetypeIntern = @messagetype end if @LevelForLogging = 'T' and 6 @messagetypeIntern in ('T', 'D', 'I', 'W', 'E') goto doit if @LevelForLogging = 'D' and @messagetypeIntern in ('D', 'I', 'W', 'E') goto doit if @LevelForLogging 7 = 'I' and @messagetypeIntern in ('I', 'W', 'E') goto doit if @LevelForLogging = 'W' and @messagetypeIntern in ('W', 'E') goto doit if @messagetypeIntern 8 = 'E' goto doit goto endlabel Doit: if exists (select top 1 1 from sys.sysprocesses p where p.spid = @@SPID and p.program_name like @Agentvgl + '%' ) 9 begin select @ApplicationNameIntern = 'DBQueue Processor' end else begin if rtrim(isnull(@ApplicationName, N'')) = N'' begin select top 1 @ApplicationNameIntern 10 = rtrim(left(program_name, 64)) from sys.sysprocesses where spid = @@spid end else begin select @ProcID = dbo.QBM_FCVStringToInt(@Applicationname, -123 11) if @ProcID <> -123 begin if OBJECT_NAME(@ProcID) > ' ' begin select @ApplicationNameIntern = OBJECT_NAME(@ProcID) end else begin select @ApplicationNameIntern 12 = @ApplicationName end end else begin select @ApplicationNameIntern = @ApplicationName end end end if @MessageString = 'SessionError' begin select @MessageString 13 = concat(dbo.QBM_FGISessionErrorForLog() , '50000', nchar(9), '0', nchar(9) , 'logged in ' , @ApplicationNameIntern , nchar(13), nchar(10) ) end if rtrim 14(isnull(@HostName, N'')) = N'' begin select top 1 @HostnameIntern = rtrim(left(HostName, 64)) from sys.sysprocesses where spid = @@spid end else begin 15select @HostnameIntern = @HostName end if rtrim(isnull(@LogonUser, N'')) = N'' begin select top 1 @LogonUserIntern = rtrim(left(nt_username, 64)) from 16sys.sysprocesses where spid = @@spid if rtrim(isnull(@LogonUserIntern, N'')) = N'' begin select top 1 @LogonUserIntern = rtrim(left(loginame, 64)) from 17 sys.sysprocesses where spid = @@spid end end else begin select @ProcID = dbo.QBM_FCVStringToInt(@Applicationname, -123) if @ProcID <> -123 begin if OBJECT_NAME 18(@ProcID) > ' ' begin select @LogonUserIntern = OBJECT_NAME(@ProcID) end else begin select @LogonUserIntern = @LogonUser end end else begin select @LogonUserIntern 19 = @LogonUser end end if @SuppressEntriesCount > 0 begin if exists (select top 1 1 from (select top (@SuppressEntriesCount) * from DialogJournal k with 20(nolock) order by MessageDate desc ) as x where x.MessageType = @messagetypeIntern and x.MessageString = @MessageString ) begin goto Endlabel end end insert 21 into DialogJournal (UID_DialogJournal, MessageType, MessageString , MessageDate , ApplicationName , LogonUser , HostName) select newid(), @messagetypeIntern 22, @MessageString , GetUTCDate() , @ApplicationNameIntern , @LogonUserIntern , @HostnameIntern END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare 23 @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return end 24
Module relation graph
Loading module relation graph…
Source-derived context
Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.
provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:20:26.060
has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd; writes INSERT DialogJournal; reads/joins sys, DialogJournal
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@MessageString | nvarchar | input |
@ApplicationName | nvarchar(64) | input |
@LogonUser | nvarchar(64) | input |
@MessageType | nchar(1) | input |
@HostName | nvarchar(64) | input |
@SuppressEntriesCount | int | input |
DML targets
INSERT DialogJournalCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @MessageString @ApplicationName @LogonUser @MessageType @HostName @SuppressEntriesCount @messagetypeIntern @ApplicationNameIntern @HostnameIntern @LogonUserIntern @LevelForLogging @ProcID @Agentvgl @messagetype @SPID @spid @Applicationname @Rethrow
Referenced by / reverse dependencies
Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.
| Referencing object | Relation | Evidence |
|---|---|---|
| dbo.QBM_PJobUnfreeze | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PJobUpdateState_Bulk | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PJournal | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PJobUnfreeze | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PJobUpdateState_Bulk | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, fires object-layer event via HOFireEvent, has TRY/CATCH error handling |
| dbo.QBM_PJournal | source text reference | has TRY/CATCH error handling |