Returns information about all the waits encountered by threads that executed for each session. You can use this view to diagnose performance issues with the SQL Server session and also with specific queries and batches. This view returns session the same information that is aggregated for sys.dm_os_wait_stats (Transact-SQL) but provides the session_id number as well.
Applies to: SQL Server 2016 (13.x) and later versions.
For SQL Server 2019 (15.x) and previous versions, if you have VIEW SERVER STATE permission on the server, you see all executing sessions on the instance of SQL Server; otherwise, you see only the current session.
For SQL Server 2022 (16.x) and later versions, you require VIEW SERVER PERFORMANCE STATE permission on the server.