xp_sqlinventory (version 6.5)

Captures SQL Server configuration and inventory information asynchronously on the SQL Server computer and stores it in the specified database and table.

Syntax

xp_sqlinventory {'DbName', 'TableName', Interval | stop}

where

DbName
Specifies the database in which to store inventory information. The DbName specified must already exist and must have enough free space to hold the retrieved inventory data. The DbName can be a maximum of 30 characters and must have a varchar datatype.
TableName
Is the name of the table in which to store the inventory information. The TableName specified will be created if it does not already exist and will store configuration information only for servers that are in the same Windows NT domain as the SQL Server running xp_sqlinventory. The TableName parameter can be a maximum of 30 characters and must be a varchar datatype.
Interval
Specifies the time (in seconds) to wait between checks for inventory messages. The Interval parameter must have an int datatype and can be a value between 1 (once per second) and 3600 (once per hour).
stop
Specifies to stop all in-progress inventory actions.

Remarks

This procedure captures SQL Server configuration and inventory information for all SQL Servers on the domain and stores the information in the specified DbName and TableName. Any SQL Server running the LocalSystem account will not be included.

Caution By default SQL Server is installed as a service in the Windows NT LocalSystem account, and the SQL Server registration and configuration information cannot be sent over the network. For this extended stored procedure to work, you must configure SQL Server to run in a valid domain user account through the Startup dialog box in Control Panel, Services.

Inventory errors are written to the Windows NT Event Log.

Note This procedure does not support named parameters.

The following inventory information is captured for each inventoried SQL Server.

Column name Description
ReceiveDate Specifies the date and time the message was received on the SQL Server.
ServerName Specifies the SQL Server machine name.
ProductName Specifies the product name of Microsoft SQL Server.
SQLRegisteredOwner Specifies the registered owner name typed in during SQL Server Setup.
DomainName Specifies the Windows NT domain name of the SQL Server.
MajorVersion Specifies the major version number for the SQL Server's version. For example, the "6" in SQL Server version 6.50 is the SQLMajorVersion.
MinorVersion Specifies the minor version number for the SQL Server version. For example, the "50" in SQL Server version 6.50 is the SQLMinorVersion.
BuildNumber Specifies the internal build number for the SQL Server version.
ServerLogins Specifies the total number of configured user logins obtained from the master.dbo.syslogins system table.
MaxConnections Specifies the maximum number of people that can be simultaneously connected to SQL Server.
DBCount Specifies the total number of databases on the server including master, tempdb, and model databases.
TotalDeviceSize Specifies the size in megabytes of all devices allocated for SQL Server data. This number does not include dump devices.
SortOrder Specifies the sort order and code page chosen at SQL Server Setup. For more information about the selected code page, see master.dbo.syscharsets where id = SortOrder.
SecurityMode Specifies the SQL Server security mode. The possible values are:

0 Standard security

1 Integrated security

2 Mixed security

ProcedureCache Specifies the percentage of memory allocated to SQL Server's procedure cache. Values may range from 1 to 99.
SMPStatus Specifies how aggressively SQL Server will use multiple microprocessors. The default value is 0. For possible values, see "SMP concurrency" in the sp_configure system stored procedure in the Microsoft SQL Server Transact-SQL Reference.
ConfiguredMemory Specifies the total amount of memory in megabytes allocated to SQL Server.
PriorityBoost Specifies whether the SQL Server has been configured to run at a higher NT process priority level. For more information about priority boost, see sp_configure in the Microsoft SQL Server Transact-SQL Reference.
WorkingSet Directs Windows NT to reserve physical memory space for SQL Server equal to the sum of the memory setting and the size of tempdb if it is in RAM. Default is 0 (no working set) and 1 (working set). For more information, see "Set working set size" in the sp_configure system stored procedure in the Microsoft SQL Server Transact-SQL Reference.
Publisher Specifies the number of publications configured for the SQL Server.
Subscriber Specifies the number of publications subscribed to for the SQL Server.
Distribution Specifies whether the SQL Server is configured as a distribution server. The possible values are:

0 Not a distribution server

1 A distribution server

SupportSNMP Specifies whether SNMP is available. For possible values, see xp_snmp_getstate, earlier in this document.
NamedPipe Specifies whether the SQL Server can accept client connections by using the named pipe Net-Library. The possible values are:

0 No

1 Yes

MultiProtocol Specifies whether the SQL Server can accept client connections by using the MultiProtocol Net-Library. The possible values are:

0 No

1 Yes

SPX Specifies whether the SQL Server can accept client connections by using the Novell IPX/SPX Net-Library. The possible values are:

0 No

1 Yes

WinSocket Specifies whether the SQL Server can accept client connections by using a WinSocket application programming interface Net-Library. The possible values are:

0 No

1 Yes

Appletalk® Specifies whether the SQL Server can accept client connections by using an Appletalk Net-Library. The possible values are:

0 No

1 Yes

VINES Specifies whether the SQL Server can accept client connections by using a Banyan® VINES® Net-Library. The possible values are:

0 No

1 Yes

DECnet™ Specifies whether the SQL Server can accept client connections by using a DECnet Net-Library. The possible values are:

0 No

1 Yes

CPUBrand Specifies the brand of the microprocessor for the SQL Server. Possible values can be Intel, Alpha, MIPS, and PowerPC.
CPUModel Specifies the microprocessor model, such as Pentium or Alpha for the SQL Server.
CPUStepLevel Specifies the processor stepping version.
CPUCount Specifies the number of microprocessors for the SQL Server.
ServerTotalMemory Specifies the total amount of physical memory in megabytes on the SQL Server.
ServerAvailableMemory Specifies the available amount of physical memory in megabytes on the SQL Server.
OperatingSystem Specifies the operating system for the SQL Server. An example is Microsoft Windows NT.
OperatingSystemBuild Specifies the internal operating system build version number for the SQL Server. An example is 1057 for the 1057 build of Windows NT 3.51 or later.
TotalPhysicalDisk Specifies the total amount of physical disk space in megabytes on non-removable storage media.
AvailablePhysicalDisk Specifies the amount of free disk space available in megabytes on the SQL Server.

Example

This example checks every two seconds for SQL Server inventory messages. The information is loaded into the db_info table in the sql_info database. After time has passed, the capturing of configure and inventory information stops.

USE pubs
go
DECLARE @db varchar(30)
DECLARE @table varchar(30)
DECLARE @interval int
SELECT @db = 'sql_info', @table = 'db_info', @interval = 2
EXECUTE master..xp_sqlinventory @db, @table, @interval
...
...
EXECUTE master..xp_sqlinventory stop