[英]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.