dbo.QBM_ZCheckInvalidDate
SQL_STORED_PROCEDURE
Created 2025-06-27T17:58:58.877 · modified 2026-04-14T23:20:29.643 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@SlotNumber | int | no |
@TablePattern | varchar | no |
@Dummy2 | varchar | no |
@DummyGenProcID | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| QBM_PExecuteSQLWithRetry_LLP | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_VHeavyLoadTables | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| dbo | QBM_FGIColumnExistsInSchema | 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_ZCheckInvalidDate ( @SlotNumber int , @TablePattern varchar(38) , @Dummy2 varchar(38) , @DummyGenProcID varchar(38) 2 ) as begin declare @table nvarchar(64) declare @column nvarchar(64) declare @SQLcmd nvarchar(max) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount 3 int declare @ElementIndex int declare @DebugSwitch int = 0 BEGIN TRY insert into @ElementBuffer (Ident1, Ident2) select c.table_name, c.column_name from 4 information_schema.columns c with (readpast) join information_schema.tables t with (readpast) on t.table_name = c.table_name and t.table_type = 'base table' 5 where c.DATA_TYPE = 'datetime' and c.column_name not like 'Xdate%' and c.IS_NULLABLE = 'YES' and t.Table_Name like @TablePattern and t.table_name not 6in (select TableName from QBM_VHeavyLoadTables ) select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin 7 select top 1 @table = bu.Ident1 , @column = bu.Ident2 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex select @SQLcmd = CONCAT('updat','e ' 8, @table , ' 9 set ' , @column , '= NULL ' , case when dbo.QBM_FGIColumnExistsInSchema(@table, 'XDateUpdated') = 1 and @column not like 'X[d,u][a,s][t,e][e,r]updated' 10 then concat('' , ' --34101 11 , XDateUpdated = getutcdate() 12 , XUserUpdated = ''', object_name(@@procid) , ''' 13 ') else 14 '' end ,' where ', @column, ' is not null and isnull(', @column, ', ''1899-12-30'' ) < ''1899-12-31''' ) if @DebugSwitch > 0 begin print @SQLcmd end exec 15 QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQLcmd , @LockTimeout_ms = default , @MaxWaitTimeForLock_s = default , @ProcIDForJournal = @@procid , @HandleErrorSilent 16 = 0 select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH end 17
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:29.643
has TRY/CATCH error handling
Summary: calls QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorAdd; writes INSERT into; reads/joins information_schema, QBM_VHeavyLoadTables
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@SlotNumber | int | input |
@TablePattern | varchar(38) | input |
@Dummy2 | varchar(38) | input |
@DummyGenProcID | varchar(38) | input |
DML targets
INSERT intoCalled 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: @SlotNumber @TablePattern @Dummy2 @DummyGenProcID @table @column @SQLcmd @ElementBuffer @ElementCount @ElementIndex @DebugSwitch @ROWCOUNT @procid @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @HandleErrorSilent
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.
No reverse dependencies extracted.