HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

sp_BlitzWho saving to a table

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
tablesavingsp_blitzwho

Problem

How to save result of sp_BlitzWho to a table? An option to save to table is not there compared to other procs like sp_Blitz.

Solution

You can declare table variable with fields fully equal to SP output and save results to it. E.g.:

DECLARE @who_results TABLE
    ([run_date] DATETIME,
     ...
    )
    INSERT INTO @who_results EXEC sp_blitzwho


After that, you can do everything you want with data in table variable.

Code Snippets

DECLARE @who_results TABLE
    ([run_date] DATETIME,
     ...
    )
    INSERT INTO @who_results EXEC sp_blitzwho

Context

StackExchange Database Administrators Q#166686, answer score: 7

Revisions (0)

No revisions yet.