SMO 和 Sql Server 7.0

发布于 2024-07-04 16:34:10 字数 416 浏览 4 评论 0 原文

有谁对 Sql Server 管理对象是否兼容有明确的答案使用 Sql Server 7.0? 文档指出:

由于 SMO 与 SQL Server 7.0、SQL Server 2000、SQL Server 2005 和 SQL Server 2008 兼容,因此您可以轻松管理多版本环境。

但尝试连接到 Sql 7 实例会让我:

“不支持此 SQL Server 版本 (7.0)。”

有没有人成功地让这两个人打得很好?

Does anyone have a definitive answer to whether Sql Server Management Objects is compatible with Sql Server 7.0?
The docs state:

Because SMO is compatible with SQL Server version 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008, you easily manage a multi-version environment.

But trying to connect to a Sql 7 instance gets me:

"This SQL Server version (7.0) is not supported."

Has anyone been successful in getting these 2 to play nice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

终陌 2024-07-11 16:34:11

Sorry for the late answer... there is partial support for SQL 2000 and SQL 7

壹場煙雨 2024-07-11 16:34:11

只是为了跟进您的评论,SQL 2008 确实有自己的 SMO 包,支持 SQL 2000、2005 和 2008,这实际上在其下载页面上有明确记录! 您是对的,您无法将 SQL 2005 SMO 连接到 SQL 2008。SMO

版本 10 中有一些不错的更新,因为如果您访问要连接的 SQL 版本上不存在的属性得到一个明智的“此属性在此版本的 SQL 上不可用”异常或类似的文字。

Microsoft SQL Server 2008 管理对象
SQL Server 管理对象 (SMO) 是一个 .NET Framework 对象模型,使软件开发人员能够创建客户端应用程序来管理 SQL Server 对象和服务。 该对象模型适用于 SQL Server 2000、SQL Server 2005 和 SQL Server 2008。

Just to follow up on your commment SQL 2008 does have its own SMO package which supports SQL 2000, 2005 and 2008 which is actually definitively documented on their download page! And you're right you can't connect SQL 2005 SMO to SQL 2008.

There are some nice updates updates in Version 10 of the SMO in that if you access properties that do not existing on the version of SQL that you are connect to you get a sensible "This property is not available on this Version of SQL" exception or words to that effect.

Microsoft SQL Server 2008 Management Objects
The SQL Server Management Objects (SMO) is a .NET Framework object model that enables software developers to create client-side applications to manage and administer SQL Server objects and services. This object model will work with SQL Server 2000, SQL Server 2005 and SQL Server 2008.

缪败 2024-07-11 16:34:11

看起来文档是错误的(并且在过去 3 年多的时间里一直是错误的!)。 我在 Reflector 的代码片段.microsoft.com/en-us/library/microsoft.sqlserver.management.common.connectionmanager.connect.aspx" rel="nofollow noreferrer">Microsoft.SqlServer.Management.Common.ConnectionManager、Microsoft.SqlServer。 ConnectionInfo

protected void CheckServerVersion(ServerVersion version) {
    if ((version.Major <= 7 || (version.Major > 9)) {
       throw new ConnectionFailureException(
          StringConnectionInfo.ConnectToInvalidVersion(version.ToString())
       );
    }
}

因此,看起来只支持 SQL 2000 和 SQL 2005。 据推测,SQL 2008(版本 10)已经更新了 SMO 程序集。

糟糕 - 猜测这个项目又回到了SQL-DMO

Looks like the docs are wrong (and have continued to be wrong for the last 3+ years!). I found this snippet with Reflector in Microsoft.SqlServer.Management.Common.ConnectionManager, Microsoft.SqlServer.ConnectionInfo

protected void CheckServerVersion(ServerVersion version) {
    if ((version.Major <= 7 || (version.Major > 9)) {
       throw new ConnectionFailureException(
          StringConnectionInfo.ConnectToInvalidVersion(version.ToString())
       );
    }
}

So, it looks like only SQL 2000 and SQL 2005 are supported. Presumably, SQL 2008 (version 10) has updated SMO assemblies.

Bummer - guess it's back to SQL-DMO for this project.

浅浅淡淡 2024-07-11 16:34:10

您可以使用 SMO 连接到 SQL Server 版本 7、2000 和 2005,但 SMO 不支持设置为兼容性级别 60、65 和 70 的数据库。

对于 SQL Server 7.0,兼容性级别为 70

显然这是相互冲突的信息...我假设如果您的数据库的兼容性级别是 70,您将无法连接。

要检查运行: EXEC sp_dbcmptlevel 'databasename'

查看此链接,看来您可以通过运行以下命令来更改兼容性级别:

EXEC sp_dbcmptlevel 'databasename', 80

显然,在更改任何内容之前请先进行备份。

you can use SMO to connect to SQL Server versions 7, 2000, and 2005, but SMO does not support databases set to compatibility levels 60, 65, and 70.

for SQL Server 7.0 the compatibility level is 70

Obviously this is conflicting information...I assume if your compatibility level of your DB is 70 you can not connect.

To check run: EXEC sp_dbcmptlevel 'databasename'

Looking through this link, it seems you might be able to change the compatibility level by running this:

EXEC sp_dbcmptlevel 'databasename', 80

Obviously make a back up before changing anything.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文