dbo.QBM_PViewDrop
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:00.490 · modified 2026-04-14T23:14:10.037 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@pattern | nvarchar | no |
@force | bit | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| QBMModuleDef | 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_PViewDrop (@pattern nvarchar(255) , @force bit = 0 ) as begin declare @SQLcmd nvarchar(max) declare @name nvarchar(255 2) declare @LengthMessage nvarchar(256) = '#LDS#Name of Element {0} is too long (30).|' declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount 3 int declare @ElementIndex int declare @crlf nvarchar(16) = nchar(13) + nchar(10) declare @CommentCode bit = 0 declare @DebugSwitch int = 0 SET XACT_ABORT 4 OFF BEGIN TRY if @@NESTLEVEL < 2 begin if exists (select top 1 1 from sys.tables t where t.name = 'QBMModuleDef' ) begin if exists (select top 1 1 from 5 QBMModuleDef d where d.UID_ModuleDef = 'MDK-Moduledefinition' ) and exists (select top 1 1 from information_schema.routines r where r.ROUTINE_type = N'function' 6 and r.ROUTINE_NAME = 'QBM_FSQObjectComment' ) begin select @CommentCode = 1 end end end insert into @ElementBuffer(LongIdent1, ContentFull) select v.name 7 , concat( case @CommentCode when 1 then concat('print dbo.QBM_FSQObjectComment (''' , v.name , ''')' , @crlf ) else '' end , 'drop view if exists "' , 8 v.name , N'"' ) from sys.views v where v.name like @pattern select @ElementCount = @@ROWCOUNT if exists (select top 1 1 from @ElementBuffer e where len 9(e.LongIdent1) > 30 and @force = 0 ) begin select top 1 @name = e.LongIdent1 from @ElementBuffer e where len(e.LongIdent1) > 30 select @LengthMessage = 10 concat(@LengthMessage , @name , '|') raiserror(@LengthMessage, 18, 1) with nowait end select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin 11 select top 1 @SQLcmd = bu.ContentFull from @ElementBuffer bu where bu.ElementIndex = @ElementIndex if @DebugSwitch > 0 begin print @sqlcmd end exec sp_executeSQL 12 @SQLcmd select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow 13() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH end 14
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:14:10.037
has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd; writes INSERT into; reads/joins sys, QBMModuleDef, information_schema
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@pattern | nvarchar(255) | input |
@force | bit | 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: #LDS #Name
Variables: @pattern @force @SQLcmd @name @LengthMessage @ElementBuffer @ElementCount @ElementIndex @crlf @CommentCode @DebugSwitch @NESTLEVEL @ROWCOUNT @sqlcmd @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_PDashBoardDefine | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PModuleRemove | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PSQLCreate | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PTableReload | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PViewBuild_FromAddOn | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PViewBuildP_intern | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PViewBuildPrepareVPUR | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PViewBuildR_intern | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PViewBuildU_intern | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PViewBuildV_intern | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PDashBoardDefine | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PModuleRemove | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PSQLCreate | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PTableReload | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QBM_PViewBuild_FromAddOn | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PViewBuildP_intern | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PViewBuildPrepareVPUR | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PViewBuildR_intern | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PViewBuildU_intern | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PViewBuildV_intern | source text reference | has TRY/CATCH error handling |