Sql server erDirection]“输入”; $result=$SqlCmd1.ExecuteNonQuery() 写入“result=$result” $SqlConnection1.Close() $SQLCmd1.Dispose()| Out Null }
我正在调用函数Sql server erDirection]“输入”; $result=$SqlCmd1.ExecuteNonQuery() 写入“result=$result” $SqlConnection1.Close() $SQLCmd1.Dispose()| Out Null },sql-server,powershell,Sql Server,Powershell,我正在调用函数将内部镜像到函数getInsertServerStatus。 连接字符串到函数(镜像)连接错误,因为未找到$server和$instance名称。您的代码中有一些错误: 首先,在函数getInsertServerStatusyou中调用mirroring,而不传递参数$svr$inst。。。。 应该是: mirroring $svr1 $inst1 ... other parameters second, Inside the function **mirroring
将
内部镜像到函数getInsertServerStatus
。
连接字符串到函数(
镜像
)连接错误,因为未找到$server
和$instance
名称。您的代码中有一些错误:
首先,在函数getInsertServerStatusyou中调用mirroring,而不传递参数$svr$inst。。。。
应该是:
mirroring $svr1 $inst1 ... other parameters
second, Inside the function **mirroring** you call **GetConnectionString**
GetConnectionString $svr $inst
不传递参数$servers$instance
应该是:
mirroring $svr1 $inst1 ... other parameters
second, Inside the function **mirroring** you call **GetConnectionString**
GetConnectionString $svr $inst
在主程序中调用GetConnectionString$servers$instance,并且不将返回值传递给变量,并且在代码中没有任何效果,请删除此行
用建议的代码修改您的代码。试着制定一个解决方案。这个问题包含许多不必要的代码。删除任何与问题无关的内容可能会显示出问题的部分。也包括实际的错误消息。假设有什么问题?函数中存在连接字符串错误(镜像)并且不知道原因?我们也不知道,因为您仍然认为没有必要实际显示错误消息。