我查看了程序菜单,发现安装了配置管理器,否则,它是相当简单的.我点击了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 – 在我问这个问题之前我注意到了股票保持单位名称,但这似乎太容易了,我想我最初的怀疑是正确的.
解决方法
$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服务并进入“属性”.然后单击“高级”选项卡,查看“库存保持单元名称”键.你会找到你正在使用的版本.