|TABLE 1 Input Parameters for sp_who1|
|@spidpool||varchar (500)||Contains one or more SPIDs separated by commas. Space is allowed around SPIDs. No other characters or symbols are allowed. Zeros preceding a SPID are ignored. A valid SPID is between 1 and 32767.
NullCheck all SPIDs.
Not nullCheck the specified SPID or pool of SPIDs.
|@status||sysname||Process status such as sleeping, runnable, or background.
NullCheck all statuses.
Not nullCheck the processes with the status.
|@loginame||sysname||SQL Server login or Windows login. Windows account should be prefixed with "domain\" and quoted in brackets () or single quote marks (' ').
NullCheck all logins.
Not nullCheck the connections established under the specified login names.
|@command||sysname||Command currently executing, such as SELECT, INSERT, or BACKUP DATABASE.
NullCheck all commands.
Not nullCheck the specified command only.
NullCheck connections in all databases.
Not nullCheck processes running in the specified database.
|@hostname||sysname||Name of the machine from which the connection originated.
NullCheck connections from all machines.
Not nullCheck processes coming from the specified machine name.
|@waittime||int||The length of time in milliseconds the SPID has been waiting.
NullCheck all processes, regardless of whether they're waiting.
0Check waiting processes (waittype > 0x0000).
> 0Check processes that have been waiting for longer than the specified time.
|@lastbatch||datetime||The last time a client process executed a batch. Can be any valid datetime format.
NullCheck batches running at all times.
Not nullCheck those connections that last ran at or later than the given time.
|@program||sysname||Application name under which the process is running.|
NullCheck all programs.
Not nullCheck only the processes running under the specified application.
|@opentran||int||The number of open transactions.|
NullCheck all processes regardless of whether there are open transactions.
Not nullCheck processes that have open transactions equal to or greater than the specified number.
|@blocked||bit||A flag indicating whether a block needs to be checked or filtered.
NullDon't bother checking on blocks.
Not nullCheck blocks.
0List processes not currently affected by blocking.
1List only blocked processes. Also, trace the head of the blocking chain.