[英]Power Shell Invoke-SQLSelect : Exception calling "Fill" with "1" argument(s):
运行电源 shell 脚本时出现此错误
Invoke-SQLSelect:使用“1”参数调用“Fill”的异常:“Execution Timeout Expired。在操作完成之前超时时间已过或服务器没有响应。”
# Import functions file for Database Access
Import-Module C:\apps\powerShell\RLID\SQLDatabaseAccess.ps1 -Force
$Connection=Connect-SQLServer -InstanceName "GP-SQLDB-300,33416" -DatabaseName "VepoBackFlow" -IntegratedSecurity $true
Invoke-SQLSelect -Connection $Connection -SelectStatement "EXECUTE dbo.UpdateVepoMeterNum"
Invoke-SQLSelect -Connection $Connection -SelectStatement "EXECUTE dbo.InsertLogRecord 'CompareMeter.ps1','Insert Row to VEPO_OUT', 'ew1844','execute dbo.UpdateVepoMeterNum'"
Close-SQLServerConeection -Connection $Connection
在尝试了很多事情之后,我通过以编程方式将超时设置为 10 分钟找到了解决方案,这似乎解决了问题。
$SQLCommand.CommandTimeout = 640
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.