简体   繁体   English

Power Shell Invoke-SQLSelect:使用“1”参数调用“Fill”的异常:

[英]Power Shell Invoke-SQLSelect : Exception calling "Fill" with "1" argument(s):

I am getting this error while running a power shell script运行电源 shell 脚本时出现此错误

Invoke-SQLSelect: Exception calling "Fill" with "1" argument(s): "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding." 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

After trying many things, I found the solution by programmatically setting the time out to 10 minutes, that seems to solve the issue.在尝试了很多事情之后,我通过以编程方式将超时设置为 10 分钟找到了解决方案,这似乎解决了问题。

$SQLCommand.CommandTimeout = 640 $SQLCommand.CommandTimeout = 640

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用“0”参数调用“ExecuteNonQuery”时发生异常 - Exception calling "ExecuteNonQuery" with "0" argument(s) 异常调用参数为“ 0”的“ ExecuteNonQuery”:“参数化查询 - Exception calling “ExecuteNonQuery” with “0” argument(s): "The parameterized query 使用“2”参数调用“.ctor”的异常:“SetParent 登录 'XXX' 失败。” - Exception calling “.ctor” with “2” argument(s): “SetParent failed for Login 'XXX'.” 使用“2”参数调用“.ctor”的异常:“数据库'XXX'的SetParent失败。” - Exception calling “.ctor” with “2” argument(s): “SetParent failed for Database 'XXX' .” 使用“ 0”参数调用“ ExecuteReader”的异常:“'='附近的语法不正确。” - Exception calling “ExecuteReader” with “0” argument(s): “Incorrect syntax near '='.” 使用Powershell部署数据库dacpac:使用“ 3”参数调用“ Deploy”的异常:“无法部署程序包。” - Deploy Database dacpac with Powershell: Exception calling “Deploy” with “3” argument(s): “Could not deploy package.” 脚本中的Power Shell自定义功能 - Power shell custom function in script 必需的参数发布dtsx Power Shell脚本 - Required parameter issue dtsx power shell script C#未处理的参数异常 - C# Unhandled Argument Exception 从包含 power shell 命令的 power shell 脚本创建代理作业 - Create agent job from power shell script with including of power shell command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM