Home > SQL Server Tips > Database Management and Administration > Undocumented DBCC: Use PSS command to view user and process information
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE MANAGEMENT AND ADMINISTRATION

Undocumented DBCC: Use PSS command to view user and process information


Serdar Yegulalp, Contributor
03.07.2006
Rating: -2.33- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


The DBCC PSS command enables you to obtain and dump out detailed information about processes and users currently connected to a SQL Server. It has remained an undocumented feature because the type of information dumped out by PSS has changed from one SQL Server edition to the next, and there's no guarantee it will continue to be supported. But it is still useful for obtaining low-level process data.

The syntax for DBCC:

DBCC TRACEON(3604)
DBCC PSS(<userID>, <processed>, <displayoptions>)

When you run PSS with nothing but user 0 as the parameter -- DBCC PSS(0) -- the database dumps out a list of all active users and their attendant processes. If you then rerun DBCC PSS with a user number and a process number, you'll see an extremely detailed dump of all of the user's flags as well as the execution context, the input stream and the output buffers for that process.

DBCC TRACEON(3604)
DBCC PSS(5,53)
<these are arbitrary user and process numbers, but you get the idea>

The <displayoptions> option is not required, but if you set it to 1 -- e.g., DBCC PSS(5,53,1) -- you'll see all open descriptors and the sequence tree for the query (if there is one) also dumped out to the console. The output buffers are raw data, so if they feature things like column names or other internal data they're usually dumped in UTF-16 format (the codepage used by SQL Server internally).

If you simply dump a user ID (except user 0) without a process ID, you'll see data for all the processes currently executing under that ID. Keep in mind this might take a while to print if you have a lot of processes currently running. Most flags dumped by PSS are not documented, but some are fairly self-evident: Language is the language ID for the connection and prowcount is the number of rows returned as set by the ROWCOUNT option for that connection.

About the author: Serdar Yegulalp is editor of the Windows Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators -- and please share your thoughts as well!


More information from SearchSQLServer.com

  • Tip: Undocumented stored procedure: View SQL Server 2000 raw data
  • Tip: Use DBCC CLEANTABLE to reclaim unused space in SQL Server tables
  • Expert response: Fragmentation based on results from DBCC SHOWCONTIG


  • Rate this Tip
    To rate tips, you must be a member of SearchSQLServer.com.
    Register now to start rating these tips. Log in if you are already a member.


    Submit a Tip




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



    RELATED CONTENT
    Database Management and Administration
    Password cracking tools for SQL Server
    Using traces in SQL Server Profiler
    Meet compliance requirements with improved database security practices
    Hardening the network and OS for SQL Server security
    Securing the server and database in SQL Server
    How SQL Server 2008 components impact SharePoint implementations
    Troubleshooting Distributed Transaction Coordinator errors in SQL Server
    Achieving high availability and disaster recovery with SharePoint databases
    Clearing the Windows page file and its effect on server performance
    Deploying a SQL Server virtual appliance for Microsoft Hyper-V

    SQL Server Stored Procedures
    SQL Server Mailbag: CALs, witnesses and unwanted changes
    SQL Server Mailbag: Stored procedures, triggers and SSRS reports
    Top tips and tricks for SQL Server database development
    Top 10 SQL Server development tips of 2008
    SQL Server trigger vs. stored procedure to receive data notification
    SQL Server errors, failures and other problems fixed from the trenches
    SQL Server and data manipulation in T-SQL
    How to use SQL Server 2008 hierarchyid data type
    SQL Server stored procedures tutorial: Write, tune and get examples
    Check SQL Server database and log file size with this stored procedure

    RELATED GLOSSARY TERMS
    Terms from Whatis.com − the technology online dictionary
    library  (SearchSQLServer.com)
    trigger  (SearchSQLServer.com)

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



    SQL Server Development - .NET, C#, T-SQL, Visual Basic
    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts