79292204

Date: 2024-12-18 19:03:35
Score: 3
Natty:
Report link

you just need to add the following parameters and execute, and it will create a "CREATE Table" statement: at the top, add this: DECLARE @Schema VARCHAR(MAX); EXEC sp_whoisactive... with whatever format you like for this procedure, but at the end add the following variables: @return_schema = 1, @SCHEMA = @schema OUTPUT PRINT @Schema

Then when you execute it to log to your table, add this parameter: @destination_table = '.dbo.<whatever you want to name the table'

Reasons:
  • No code block (0.5):
  • Unregistered user (0.5):
  • User mentioned (1): @Schema
  • User mentioned (0): @return_schema
  • User mentioned (0): @SCHEMA
  • User mentioned (0): @schema
  • User mentioned (0): @Schema
  • User mentioned (0): @destination_table
  • Low reputation (1):
Posted by: user28843997