sql-server – 如何在没有安装SSMS的情况下找到SQL Server版本/版本?

前端之家收集整理的这篇文章主要介绍了sql-server – 如何在没有安装SSMS的情况下找到SQL Server版本/版本?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何在没有安装管理工作室的情况下找出安装的版本?我有一台服务器,作为另一个软件的许可证管理器.在调查高RAM使用率警报后,我发现sqlservr.exe进程占用了近2 GB的RAM.

我查看了程序菜单,发现安装了配置管理器,否则,它是相当简单的.我点击了EXE文件属性,找到了10.50.1600.1,但是我发现没有地方说明是Express,Dev,STN,ENT等.

如果我不得不猜测,这是一个快速版本,但我想知道是否有明显的告示标志.

更新:
@Bob – 该文件告诉我我所知道的,而不是版本.

@valo – 当我运行该命令时,我收到以下错误,并且我确实启用了命名管道:

HResult 0x35,Level 16,State 1
Named Pipes Provider: Could not open a connection to sql Server [53].
sqlcmd: Error: Microsoft sql Server Native Client 10.0 : A network-related or instance->specific error has occurred while establishing a connection to sql Server. Server is not >found or not accessible. Check if instance name is correct and if sql Server is configured >to allow remote connections. For more information see sql Server Books Online..
sqlcmd: Error: Microsoft sql Server Native Client 10.0 : Login timeout expired.

@thomas – 在我问这个问题之前我注意到了股票保持单位名称,但这似乎太容易了,我想我最初的怀疑是正确的.

解决方法

这可以通过WMI完成(在下面的示例中通过Power Shell访问).我正在做的就是通过sqlServiceAdvancedProperty类查看sql Server服务的属性(“SKUNAME”).注意,有一些特定于环境的变量需要在代码顶部相应地设置.
$ComputerName = "YourComputerName"
$ServiceName = 'YourEngineServiceName'
$PropertyName = "SKUNAME"

# retrieve the most current version of the ComputerManagement namespace
#
$ComputerManagementNamespace =
    (Get-WmiObject -ComputerName $ComputerName -Namespace "root\microsoft\sqlserver" -Class "__NAMESPACE" |
        Where-Object {$_.Name -like "ComputerManagement*"} |
        Select-Object Name |
        Sort-Object Name -Descending |
        Select-Object -First 1).Name

if ($ComputerManagementNamespace -eq $null) {
    Write-Error "ComputerManagement namespace not found"
}
else {
    $ComputerManagementNamespace = "root\microsoft\sqlserver\" + $ComputerManagementNamespace
} 

# get the property and its value
#
Get-WmiObject -ComputerName $ComputerName -Namespace $ComputerManagementNamespace -Class "sqlServiceAdvancedProperty" |
    Where-Object {
        $_.ServiceName -eq $ServiceName -and
        $_.PropertyName -eq $PropertyName
    } |
    Select-Object @{Name = "ComputerName"; Expression = { $ComputerName }},ServiceName,@{Name = "PropertyValue"; Expression = {
            if ($_.PropertyValueType -eq 0) {
                $_.PropertyStrValue
            }
            else {
                $_.PropertyNumValue
            }
        }}

同样,可以在sql Server配置管理器工具中直接找到相同的信息.打开它后,右键单击sql Server服务并进入“属性”.然后单击“高级”选项卡,查看“库存保持单元名称”键.你会找到你正在使用的版本.

原文链接:https://www.f2er.com/mssql/80631.html

猜你在找的MsSQL相关文章