April 7, 2004 at 12:02 am
Is there any method (T-SQL, extended stored proc, ...) that I can determine the licensing mode for a particular instance of SQL Server? I was hoping that sp_server_info would work, but it doesn't appear that licensing mode is one of the supported attributes.
We would like to deploy our schema to client server(s), but would like to be able to determine (from within our application), what the current license is for that particular instance. We would like to know whether its user CALs, device CALs, or processor - and how many CALs or processors are licensed.
Any suggestions?
April 12, 2004 at 8:00 am
This was removed by the editor as SPAM
April 12, 2004 at 8:55 am
Try the below script....if you are using named instances you'll need to change the registry location....
CREATE TABLE #LICENSE_RESULTS (LICENSETYPE VARCHAR(25), LICENSECOUNT INT)
DECLARE @MODE VARCHAR(25)
DECLARE @testmode int
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\80\MSSQLLicenseInfo\MSSQL8.00',
@value_name='Mode',
@value=@testmode OUTPUT
--SELECT @testmode
IF @testmode = 1
BEGIN
SET @mode = 'Per Seat'
END
ELSE
BEGIN
SET @mode = 'Per Processor'
END
DECLARE @testlimit int
EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='Software\Microsoft\Microsoft SQL Server\80\MSSQLLicenseInfo\MSSQL8.00',
@value_name='ConcurrentLimit',
@value=@testlimit OUTPUT
--SELECT @testlimit
INSERT INTO #LICENSE_RESULTS VALUES (@MODE, @TESTLIMIT)
SELECT * FROM #LICENSE_RESULTS
September 28, 2004 at 3:51 pm
SELECT CONVERT(char(20), SERVERPROPERTY('NumLicenses'))
--returned "PER_PROCESSOR" in my cluster
SELECT CONVERT(char(20), SERVERPROPERTY('LicenseType'))
--returned "4" in my 4 processor cluster
-- Look up SERVERPROPERTY in BOL
November 23, 2004 at 10:27 am
This query was just what I needed.
Thanks!
November 23, 2004 at 11:40 am
Just be aware of this:
http://support.microsoft.com/default.aspx?scid=KB;en-us;291332
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply