You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the error: Error running SQL script: Exception calling "ExecuteNonQuery" with "0" argument(s): "Could not find stored procedure 'GO'."
This happens because there are two or more "GO" statements back to back. The fix for this is to check to see if the only text is a GO statement in the object. Both commands in the switch statement (lines 54 and 58) can be replaced with: ForEach-Object { $SqlCmd.CommandText = $_.Trim(); if (!$SqlCmd.CommandText.Equals("GO")) {$reader = $SqlCmd.ExecuteNonQuery()} }
This resolves the issue no matter how many GO statements there are.
The text was updated successfully, but these errors were encountered:
I get the error: Error running SQL script: Exception calling "ExecuteNonQuery" with "0" argument(s): "Could not find stored procedure 'GO'."
This happens because there are two or more "GO" statements back to back. The fix for this is to check to see if the only text is a GO statement in the object. Both commands in the switch statement (lines 54 and 58) can be replaced with:
ForEach-Object { $SqlCmd.CommandText = $_.Trim(); if (!$SqlCmd.CommandText.Equals("GO")) {$reader = $SqlCmd.ExecuteNonQuery()} }
This resolves the issue no matter how many GO statements there are.
The text was updated successfully, but these errors were encountered: