データベースを作成するために"SQL"
Windows で実行する必要があるスクリプトがあります。Powershell
スクリプトには既にドロップおよび作成機能が含まれているため、コマンド ラインの最後にデータベース名を追加する必要はありません。コマンドラインを実行しようとすると、次のエラーが表示されます
"Invoke-Sqlcmd : A network-related or instance-specific error occurred while establishing a connection to SQL Server
The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)
At line:1 char:14
+ invoke-sqlcmd <<<< -inputfile "c:\A.sql" -serverinstance "Louis_dev\MSSQLSERVER"
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException
+ FullyQualifiedErrorId : SqlExectionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
Invoke-Sqlcmd :
At line:1 char:14
+ invoke-sqlcmd <<<< -inputfile "c:\A.sql" -serverinstance "Louis_dev\MSSQLSERVER"
+ CategoryInfo : ParserError: (:) [Invoke-Sqlcmd], ParserException
+ FullyQualifiedErrorId : ExecutionFailureException,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand"
それがinvokeコマンドであるかどうかわからないので、すでにこのリンクの手順に従っていますPowershellを使用して.sqlファイルを実行する方法? . このエラーの回避策がある可能性はありますか。SQLSERVER
インスタンスは、ネットワーク インスタンスに対して構成されLocalSystem
ていて、ネットワーク インスタンスに対して構成されていません