PowerShellからSQLServerにログインができない

大谷仁茂 21 Reputation points
2020-06-16T02:12:04.257+00:00

お世話になっております。

SQLServer(2014 Express)で作成したDBにPowerShellにてログインしたところ、以下のようなエラーが出力されます。

ーーーーーーーーーーーー

> $sqlserver=***********
>Invoke-Sqlcmd -ServerInstance $sqlserver -Database master -InputFile D:\Work\test.sql
Invoke-Sqlcmd : ファイルまたはアセンブリ 'Microsoft.SqlServer.BatchParser, Version=12.0.0.0, Culture=neutral, PublicKey
Token=89845dcd8080cc91'、またはその依存関係の 1 つが読み込めませんでした。指定されたファイルが見つかりません。
発生場所 行:1 文字:1

  • Invoke-Sqlcmd -ServerInstance $sqlserver -Database master -InputFile "D:\Work\te ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:) [Invoke-Sqlcmd], FileNotFoundException
  • FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.SqlServer.Management.PowerShell.GetScriptComma
    nd
    ーーーーーーーーーーーー

以下サイトにて、“drive:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.AnalysisServices.AdomdClient”を確認するように記載がありますが、対象のファイルがありませんでした。また、対象がSQLServer2016と書かれているので、以下サイトで解決するのかが不明です。

https://support.microsoft.com/en-us/help/4134601/could-not-load-file-assembly-microsoft-analysisservices-adomdclientui

上記URLのほかに何か対処法等はあるかご教示ください。

Community Center | Not monitored
0 comments No comments

Answer accepted by question author

Anonymous
2020-06-16T02:27:59.233+00:00

QnA forums are currently english only.

SQL Server and PowerShell is not currently supported here on QnA. They're actively answering question in dedicated forums here.

https://social.msdn.microsoft.com/Forums/sqlserver/ja-JP/home?forum=sqlserverja

https://social.technet.microsoft.com/Forums/windows/ja-JP/home?forum=powershellja

--please don't forget to Accept as answer if the reply is helpful--


Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management

Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. 大谷仁茂 21 Reputation points
    2020-06-16T04:20:04.483+00:00

    I am sorry.
    I will throw QA again to the site you are guided to

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.