将 SQL Server 2008 降级到 SQL Server 2005

发布于 2024-07-18 18:42:38 字数 120 浏览 3 评论 0原文

从 SQL Server 2008 备份数据库然后将其导入 SQL Server 2005 是否存在任何问题? 我已经升级到SQL Server 2008,但是2008似乎问题太多,所以现在我想降级。 这样做有什么问题吗?

Are there any issues backing up a database from SQL Server 2008, and then importing it into SQL Server 2005? I had upgraded to SQL Server 2008, but 2008 seems to be too problematic so now I want to downgrade. Are there any problems in doing this?

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

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

发布评论

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

评论(4

月朦胧 2024-07-25 18:42:38

那么,您将无法将 2008 年的备份恢复到 SQL 2005 服务器。

最简单的方法是使用“生成 SQL Server 脚本”向导来创建一个脚本(包括架构和数据),您可以在 SQL 2005 上运行该脚本来创建数据库。 请参阅 http://www.devx.com/dbzone/Article/40531

但回到原问题:您在使用 SQL 2008 时遇到了什么问题?

Well, you won't be able to restore a 2008 backup to a SQL 2005 server.

Easiest way to do it is to use the "Generate SQL Server Scripts" wizard to create a script (including schema and data) that you can run on SQL 2005 to create the database. See http://www.devx.com/dbzone/Article/40531

But back to the original issue: what problems are you having with SQL 2008?

梦里的微风 2024-07-25 18:42:38

另一种方法是通过对象资源管理器连接到两台服务器,并将数据从一台服务器导入另一台服务器。

然而,执行此操作时,有些内容无法正确传输。 例如,我必须手动重置主键和外键设置以及自动增量设置。 不过,为了让所有数据发挥作用,这只是一个很小的代价。

The other way to do this is to connect to both servers via the object explorer and import data from one into the other.

When doing this, some things don't transfer correctly, however. For example, I had to manually reset the primary and foreign key settings, as well as the auto-increment setting. That was a small price to pay, though, for getting all the data to work.

蓝眼泪 2024-07-25 18:42:38

我同意这是什么问题? 如果与应用程序有关,您可以不以 SQL 2005 兼容模式运行数据库吗? 如果你必须移动到 2005 年,你不能只是将数据库从 08 恢复到 05。

如果你有一个大于 50mb 左右的数据库,我将使用脚本生成向导编写你的数据库模式的脚本,编写所有键、索引、触发器的脚本,排序规则和任何没有数据的全文索引。 请记住检查脚本中的 sql 2005 版本选项。 运行该脚本在您的 sql server 2005 上创建一个新数据库。

如果您的表上有触发器,您将需要在导入数据之前禁用它们。 这些脚本将为您做到这一点。
这些将为您完成此操作

-- Disable Triggers
While @i <= @MaxI
Begin
      Select @dsql =  'DISABLE Trigger ' + TriggerName + ' ON ' + TableName
      From @DisableTriggers
      Where MyRowCount = @i
      Exec sp_executesql @dsql
      Select @i = @i + 1
End

-- Enable Triggers
While @i <= @MaxI
Begin
      Select @dsql =  'Enable Trigger ' + TriggerName + ' ON ' + TableName
      From @DisableTriggers
      Where MyRowCount = @i
      Exec sp_executesql @dsql
      Select @i = @i + 1
End

然后使用导入/导出向导将数据导入到您的数据库中; 根据我的经验,这比编写脚本要快得多。

I would agree what is the issue ? can you not run the database in SQL 2005 compatability mode if it is something about the application. If you must move to 2005 you cant just restore the database from 08 to 05.

If you have a DB that is bigger than 50mb or so I would script your database schema using the script generation wizard, script all your keys, indices, triggers, collation and any full text indices you have without the data. Just remember to check the script for sql 2005 version option. Run that script to create a new database on your sql server 2005.

If you have triggers on your tables you will want to disable them all before you import the data. These scripts will do that for you.
These will do that for you

-- Disable Triggers
While @i <= @MaxI
Begin
      Select @dsql =  'DISABLE Trigger ' + TriggerName + ' ON ' + TableName
      From @DisableTriggers
      Where MyRowCount = @i
      Exec sp_executesql @dsql
      Select @i = @i + 1
End

-- Enable Triggers
While @i <= @MaxI
Begin
      Select @dsql =  'Enable Trigger ' + TriggerName + ' ON ' + TableName
      From @DisableTriggers
      Where MyRowCount = @i
      Exec sp_executesql @dsql
      Select @i = @i + 1
End

Then use the import / export wizard to import the data into your database; this is much quicker than script out script in my experience.

赢得她心 2024-07-25 18:42:38

您无法还原从 SQL Server 2008 获取的 SQL Server 数据库备份并在 SQL Server 2005 上还原它,因为 Microsoft 不支持此操作。 要了解更多为什么无法将数据库从较高版本恢复到较低版本,请阅读以下内容 文章。 如果您想降级数据库,则可以利用 SQL Server Integration Services。 以下文章中提到了将 SQL Server 2008 数据库降级到 SQL Server 2005 的示例< /a>

You cannot restore a SQL Server Database backup taken from SQL Server 2008 and restore it on SQL Server 2005 as this is not supported by Microsoft. To know more why you can’t restore a database from higher version to lower version then read the following article. If you want to downgrade the database then use can utilize SQL Server Integration Services. An example to downgrade a SQL Server 2008 database to SQL Server 2005 is mentioned in the following article.

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