This relates to Per Device CALs and Per User CALs only.
There is no easy way within Microsoft SQL Server to find the number of CALs that are currently in use. What I will attempt to provide here is a fairly easy way to get a high watermark of the number of CALs that are being used by the system based on the number of people who are currently logged in. If you are using connection pooling or some sort of middleware this will not work. (If you are using connection pooling or some sort of middleware you probably should be using processor licensing anyway. See FAQ962-5153 for more information on selecting a licensing model.)
First Create a table in the master database, or any database you wish. I'm using master for this example.