SQL Server 2000 Undocumented Stored Procedures


This stored procedure can be used to get the total size and the space used by the tempdb database. It is used without parameters.



This is the example:

EXEC sp_tempdbspace

Here is the result set from my machine:

database_name database_size           spaceused

————- ———————– —————————–

tempdb           9.750000                   .562500


This stored procedure returns information about current SQL Server 2000 users and processes similar to sp_who, but it provides more detailed information. sp_who2 returns CPUTime, DiskIO, LastBatch and ProgramName in addition to the data provided by sp_who.


sp_who [loginame]


loginame – the user’s login name. If not specified, the procedure reports on all active users of SQL Server.

This example returns information for the ‘sa’ login:

EXEC sp_who2 ‘sa’

Published with the explicit written permission of the author. Copyright 2001 Alexander Chigrik


Leave a comment

Your email address will not be published.