SQL Network Interfaces, error: 25 - Connection string is not valid in Powershell

后端 未结 6 623
天命终不由人
天命终不由人 2021-01-12 10:36
$SQLconnection = New-Object System.Data.SqlClient.SqlConnection
$SQLconnection.ConnectionString = \"Server = MySQLservername\\MSSQLSERVER; Database = \"MYSQLDB\"; In         


        
6条回答
  •  天涯浪人
    2021-01-12 11:28

    As far as I am aware, it has never been a requirement to quote the server or databasename in a connection string. You should be using this

    $SQLconnection.ConnectionString = "Server=MySQLservername\MSSQLSERVER;Database=MYSQLDB;Integrated Security=True"
    

提交回复
热议问题