INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Microsoft SQL Server: Setup and Administration FAQ

Licensing

Finding the number of SQL Licenses in use by mrdenny
Posted: 19 Oct 04 (Edited 19 Oct 04)

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.

CODE

create table _LicenseCheck
(SampleTaken datetime,
LicensesUsed int)
Now schedule one of these queries depending on if you are using User CALs or Device CALs.

CODE

/*This code is for Device CALs*/
insert into _LicenseCheck
select getdate(), count(distinct hostname)
from sysprocesses

CODE

/*This code is for User CALs*/
insert into _LicenseCheck
select getdate(), count(distinct Loginame)
from sysprocesses
You will want to schedule this query to run every couple of minutes through out the day for a week or so.

In order to find the high watermark simply query the table.

CODE

select *
from _LicenseCheck
where LicensesUsed = (select max(LicensesUsed) from _LicenseCheck)

Back to Microsoft SQL Server: Setup and Administration FAQ Index
Back to Microsoft SQL Server: Setup and Administration Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close