amachanic / sp_whoisactive

sp_whoisactive
GNU General Public License v3.0
1.17k stars 289 forks source link

@sort_order doesn't seem to work #26

Closed erikdarlingdata closed 4 years ago

erikdarlingdata commented 4 years ago

While working on some Great Posts™, I found a bit of odd behavior: image

It appears to be a case sensitivity issue, because this works: EXEC sp_WhoIsActive @find_block_leaders = 1, @sort_order = '[blocked_session_count] desc', @show_own_spid = 1;

image

Easily fixed by doing this:

WHEN LOWER(tokens.next_chunk) LIKE '%asc%' THEN ' ASC'
WHEN LOWER(tokens.next_chunk) LIKE '%desc%' THEN ' DESC'

PR incoming!

amachanic commented 4 years ago

Well that's what you get, I guess, for running on a case-sensitive database?!?!

Thanks for the PR! I'll push it through in a day or so.

erikdarlingdata commented 4 years ago

it's hard to believe that this has never come up before 😃