Back to OIM Explorer

dbo.QBM_PCursorDrop

Stored ProcedureSQL_STORED_PROCEDURESandbox DB

Stored Procedure.

Source: sandbox-db sys.sql_modules

Source size: 976 characters

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_PExecuteSQLWithRetry_LLP source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL41 lines
1CREATE PROCEDURE QBM_PCursorDrop(2  @Cursorname nvarchar(255)3)4AS5BEGIN6  DECLARE @SQLcmd nvarchar(max)7  SET XACT_ABORT OFF8  BEGIN TRY9    SELECT10      @SQLcmd = '11if CURSOR_STATUS(N''Global'', N''@Cursorname'') = -312 begin13	if CURSOR_STATUS(N''Local'', N''@Cursorname'') >= 0 close @Cursorname14	if CURSOR_STATUS(N''Local'', N''@Cursorname'') >= -1 deallocate @Cursorname15 end16else17 begin18	if CURSOR_STATUS(N''Global'', N''@Cursorname'') >= 0 close @Cursorname19	if CURSOR_STATUS(N''Global'', N''@Cursorname'') >= -1 deallocate @Cursorname20 end21 22'23    SELECT24      @SQLcmd = replace(@SQLcmd,25      N '@Cursorname',26      @Cursorname)27    EXEC QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQLcmd,28      @LockTimeout_ms = DEFAULT,29      @MaxWaitTimeForLock_s = DEFAULT,30      @ProcIDForJournal = DEFAULT,31      @HandleErrorSilent = 032  END TRY33  BEGIN CATCH34    EXEC QBM_PSessionErrorAdd DEFAULT35    DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()36    RAISERROR(@Rethrow,37    18,38    1)39      WITH NOWAIT40  END CATCH41END
Open raw exported source
SQL ยท Raw18 lines
1    create   procedure QBM_PCursorDrop (@Cursorname nvarchar(255)) as begin  declare @SQLcmd nvarchar(max)  SET XACT_ABORT OFF BEGIN TRY  select2 @SQLcmd = '3if CURSOR_STATUS(N''Global'', N''@Cursorname'') = -34 begin5	if CURSOR_STATUS(N''Local'', N''@Cursorname'') >= 0 close @Cursorname6	if CURSOR_STATUS(N''Local'', N''@Cursorname'') >= -1 deallocate @Cursorname7 end8else9 begin10	if CURSOR_STATUS(N''Global'', N''@Cursorname'') >= 0 close @Cursorname11	if CURSOR_STATUS(N''Global'', N''@Cursorname'') >= -1 deallocate @Cursorname12 end13 14'15 select @SQLcmd = replace (@SQLcmd , N'@Cursorname',@Cursorname) exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQLcmd , @LockTimeout_ms = default 16, @MaxWaitTimeForLock_s = default , @ProcIDForJournal = default , @HandleErrorSilent = 0 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare 17@Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH end 18