The sp_who and sp_who2 are the two most used system stored procedure to get information on users, sessions, and processes of an instance in an SQL Server. In a production environment, it becomes an important aspect for a DBA to get the SQL Server processes running. Though both systems' stored procedures are used to get the users, sessions, and processes information, there are some key differences.
sp_who
- The sp_who has limited columns to show. The results are all related to the processes running in an SQL Server instance.
- The sp_who is official and documented by Microsoft.
- The sp_who is supported by Microsoft.
Sp_who2
- The sp_who2 has more columns to show than the sp_who. Like sp_who, the results are all related to the processes running in an SQL Server instance.
- The sp_who2 is not official and is documented by Microsoft.
- The sp_who2 is not supported by Microsoft.
Bottomline
Both sp_who and sp_who2 stored procedures are handy for a DBA to get the process information in SQL Server. For less column information you can prefer to go with sp_who whereas for more column information you can prefer to go with sp_who2. You can judge which stored procedure to use based on your requirement.
0 comments:
Post a Comment