marcingminski / sqlwatch

SQL Server Performance Monitor
https://docs.sqlwatch.io
Other
428 stars 168 forks source link

Fixed sp_WhoIsActive time collection criteria #400

Closed MCTSQL closed 3 years ago

MCTSQL commented 3 years ago

Line 75: where [start_time] < dateadd(s, -@min_session_duration_seconds,getdate())

marcingminski commented 3 years ago

Hi, thanks for this. This proc has not changed in years so it must have always been wrong. Im thinking, would it not be better to check if the input is negative and only add the minus if it is not? - that’s in case someone passes already negative value as a parameter to prevent errors?