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

Pages: 1 2 3 4 5


No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |