E475 `sp_HumanEvents` - Refactor To Remove `LOWER(@event_type)` · Issue #640 · erikdarlingdata/DarlingData · GitHub
[go: up one dir, main page]

Skip to content

sp_HumanEvents - Refactor To Remove LOWER(@event_type) #640

@mattcargile

Description

@mattcargile

Is your feature request related to a problem? Please describe.
Would you be open to setting @event_type to LOWER further up the in the code? Or maybe refactor with a new variable which LOWER-ed @event_type ( i.e. @event_type_lower )? Then I can remove all the LOWER(@event_type) in the code? ( NOTE: I did find one LOWER()that was missed onobject_name. Some of that codemay change with theLIKE` implementation though ).

IF @object_name <> N''
BEGIN
IF @event_type LIKE N'%lock%'
BEGIN
SET @object_id = OBJECT_ID(@fully_formed_babby);
SET @object_name_filter += N' AND object_id = ' + @object_id + @nc10;
END;
IF @event_type NOT LIKE N'%lock%'
BEGIN
SET @object_name_filter += N' AND object_name = N' + QUOTENAME(@object_name, N'''') + @nc10;
END;
END;

Describe the solution you'd like
Override the parameter variable.

Describe alternatives you've considered
New variable

Are you ready to build the code for the feature?
Yes I can do the refactor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0