amachanic / sp_whoisactive

sp_whoisactive
GNU General Public License v3.0
1.14k stars 281 forks source link

Might trim query text sometimes #23

Closed artshade closed 4 years ago

artshade commented 4 years ago

Dear Developer,

Thank you for this project.

Although, the procedure might return trimmed query text sometimes. Please, check StackOverflow post for more information.

Regards

BrentOzar commented 4 years ago

That's not a bug - that's by design. If you run it while the WAITFOR is executing, then the WAITFOR is the part that's active, so that's the query that'll return. That's why Adam's proc is called sp_WhoIsActive, not sp_WhoWillBeActiveLater. It shows the currently executing statement.

BrentOzar commented 4 years ago

Another way to see it is to run sp_WhoIsActive several times in another window while you execute this:

WAITFOR DELAY '00:00:01';
SELECT GETDATE();
WAITFOR DELAY '00:00:02';
SELECT GETDATE();
WAITFOR DELAY '00:00:03';
SELECT GETDATE();
WAITFOR DELAY '00:00:04';
SELECT GETDATE();
WAITFOR DELAY '00:00:05';
SELECT GETDATE();

You'll notice sp_WhoIsActive isn't trimming. It's just always cleverly showing you - wait for it - who is active. ;-)

artshade commented 4 years ago

Sure thing. No one said it's a bug, but someone might need a full text of query instead of a trimmed(active part of it) one. Thus, what about adding a parameter to show such? Also, it's would be sensible to set this parameter active by default because(might be) usually you want to know what exactly is running.

BrentOzar commented 4 years ago

You mean like @get_outer_command that’s clearly described in the documentation? http://whoisactive.com/docs/10_commands/


Tiny glass keyboard Typos flowing like rivers As winter snow thaws

On Jul 17, 2020, at 3:49 PM, Angel notifications@github.com wrote:

 Sure thing. No one said it's a bug, but someone might need a full text of query instead of a trimmed(active part of it) one. Thus, what about adding a parameter to show such?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

artshade commented 4 years ago

Sorry. Did not notice at the very end.