| title | xp_msver (Transact-SQL) | ||
|---|---|---|---|
| description | Returns version information about SQL Server. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
Returns version information about [!INCLUDE ssNoVersion]. xp_msver also returns information about the actual build number of the server and information about the server environment. The information that xp_msver returns can be used within [!INCLUDE tsql] statements, batches, stored procedures, and so on, to enhance logic for platform-independent code.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
xp_msver [ 'optname' ]
[!INCLUDE extended-stored-procedures]
The name of an option, and can be one of the following values.
| Option or column name | Description |
|---|---|
| ProductName | Product name; for example, [!INCLUDE ssNoVersion]. |
| ProductVersion | Product version. |
| Language | The language version of [!INCLUDE ssNoVersion]. |
| Platform | Operating-system name, manufacturer name, and chip family name for the computer that is running [!INCLUDE ssNoVersion]. |
| Comments | Miscellaneous information about [!INCLUDE ssNoVersion]. |
| CompanyName | Company name that produces [!INCLUDE ssNoVersion]; for example, [!INCLUDE msCoName] Corporation. |
| FileDescription | The operating system. |
| FileVersion | Version of the [!INCLUDE ssNoVersion] executable. |
| InternalName | [!INCLUDE msCoName] internal name for [!INCLUDE ssNoVersion]; for example, SQLSERVR. |
| LegalCopyright | Legal copyright information required for [!INCLUDE ssNoVersion]; for example, Copyright© [!INCLUDE msCoName] Corp. 1988-2005. |
| LegalTrademarks | Legal trademark information required for [!INCLUDE ssNoVersion]. For example, [!INCLUDE msCoName] is a registered trademark of [!INCLUDE msCoName] Corporation. |
| OriginalFilename | File name executed at [!INCLUDE ssNoVersion] startup; for example, Sqlservr.exe. |
| PrivateBuild | [!INCLUDE ssInternalOnly] |
| SpecialBuild | [!INCLUDE ssInternalOnly] |
| WindowsVersion | Version of Windows that is installed on the computer that is running [!INCLUDE ssNoVersion]. |
| ProcessorCount | The number of processors in the computer that is running [!INCLUDE ssNoVersion]. |
| ProcessorActiveMask | Indicates the processors installed in the computer that is running [!INCLUDE ssNoVersion] that are started and usable by [!INCLUDE msCoName] Windows. |
| ProcessorType | Processor type. Similar to Platform. |
| PhysicalMemory | Amount in megabytes (MB) of RAM installed on the computer that is running [!INCLUDE ssNoVersion]. |
| Product ID | Product ID (PID) number. This is specified during installation. This number is located on a sticker on the original [!INCLUDE ssNoVersion] CD case. |
1 (success).
xp_msver, without any parameters, returns a four-column result set that lists all the option values. xp_msver, for any parameter, returns the four-column result set with values for that option.
Requires membership in the public role.