locked
PowerShell Invoke-Sqlcmd RRS feed

  • Question

  • Hello,

    I am running a powershell script with an Invoke-Sqlcmd but I am getting the following error with my script :

    "Cannot open file because the current provider (Microsoft.SqlServer.Management.PSProvider\SqlServer) cannot open a file."

    I try to do some research on internet but I cannot find anything related to that. I am wondering if somebody had the same issue in the past?

    Thanks,

    James

    Tuesday, September 5, 2017 1:17 AM

Answers

  • It's a script where I am using parallelism, as I said, it works well on one server.

    Since it works well that sounds like yu have a server problem.  We do not fix server issues.  You will have to contact a server tech for that.

    \_(ツ)_/

    • Marked as answer by James Jean Tuesday, September 5, 2017 5:03 AM
    Tuesday, September 5, 2017 3:50 AM

All replies

  • Without your script there is no way to know what is causing this.


    \_(ツ)_/

    Tuesday, September 5, 2017 2:03 AM
  • It's a script where I am using parallelism, as I said, it works well on one server.
    Tuesday, September 5, 2017 2:30 AM
  • I did not mean everything.  Just post  the lines in question and the complete error message.


    \_(ツ)_/

    Tuesday, September 5, 2017 3:49 AM
  • It's a script where I am using parallelism, as I said, it works well on one server.

    Since it works well that sounds like yu have a server problem.  We do not fix server issues.  You will have to contact a server tech for that.

    \_(ツ)_/

    • Marked as answer by James Jean Tuesday, September 5, 2017 5:03 AM
    Tuesday, September 5, 2017 3:50 AM
  • Thanks for your help, I will contact a server tech.
    Tuesday, September 5, 2017 4:40 AM