SQL 网络接口,错误:25 - 连接字符串在 Powershell 中无效 [英] SQL Network Interfaces, error: 25 - Connection string is not valid in Powershell

查看:38
本文介绍了SQL 网络接口,错误:25 - 连接字符串在 Powershell 中无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$SQLconnection = New-Object System.Data.SqlClient.SqlConnection
$SQLconnection.ConnectionString = "Server = MySQLservername\MSSQLSERVER; Database = "MYSQLDB"; Integrated Security = True"
$SQLconnection.open()

在 MSSQL 2012 中,有效.在 MSSQL 2005 中,获得 SQL 网络接口,错误:25 - 连接字符串无效.

In MSSQL 2012, works. In MSSQL 2005, got SQL Network Interfaces, error: 25 - Connection string is not valid.

如果仅在连接字符串中使用Server = MySQLServername",则有效.我确定实例名称是正确的.是SQL 2005的bug吗?

If use "Server = MySQLServername" only in connectionstring, works. I am sure the instance name is right. Is it a bug of SQL 2005?

推荐答案

Per MS,无法连接到默认实例,MSSQLSERVER,按名称.您必须省略实例名称.我已经在 MS SQL 2008R2 和 2014 SP2 中验证了这个相同的功能".

Per MS, you can't connect to the default instance, MSSQLSERVER, by name. You have to omit the instance name. I've verified this same "feature" in MS SQL 2008R2 and 2014 SP2.

可能是您在 2012 年配置的某些内容启用了它,但我的默认设置不适用于它.

There might be something that you configured in 2012 that enabled it, but my default setups don't work with it.

这篇关于SQL 网络接口,错误:25 - 连接字符串在 Powershell 中无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆