我目前正在尝试执行命令 add-sqlsnappin
给我错误消息
SQL Server Provider for Windows PowerShell is not installed.
At C:deploySIF.Sitecore.Commerce.1.1.4ModulesDeployCommerceDatabaseDeployCommerceDatabase.psm1:215 char:9
+ throw "SQL Server Provider for Windows PowerShell is not inst ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (SQL Server Prov... not installed.:String) [], RuntimeException
+ FullyQualifiedErrorId : SQL Server Provider for Windows PowerShell is not installed.
这不可能是真的,因为
if (Get-Module -ListAvailable -Name SqlServer) {
>> Write-Host "Module exists"
>> } else {
>> Write-Host "Module does not exist"
>> }
Module exists
那么为什么我不能添加sqlsnapin呢?
sqlserver
模块和SQL Server管理单元不是一回事。因此,现有的模块并不意味着管理单元已注册以便您加载它。看看 MSDN 上运行的 SQL Server PowerShell。如果需要 SqlServer 模块,请尝试以下操作:
Import-Module sqlserver