Change SQL Server database version

老子叫甜甜 提交于 2021-02-20 19:51:14

问题


I have a SQL Server 2008 version database (version number 655). If I try to create for attach it to a SQL Server 2005 or SQL Server 2000, I get an error:

This database is version 655. This server is compatible with version 612 or previous

Of course I can attach the database to SQL Server 2008 without errors. I know I can generate SQL commands for the structure, but there is a lot of data also in many tables.

If I can change the internal database version (the compatibility level is now set to SQL Server 2000), the attach process in any server version will work, as this process updates the version automatically.

Any suggestions?

EDIT: I just realized that if the update of the version number is automatic, there will be no way of doing a version change. So, I reformulate the question:

Do you know any tool that generate a "package" with data and structure that is compatible for SQL Server versions from 2000 to 2008? A tool or a Script, perhaps.

Thanks again.

Thanks in advance.


回答1:


You cannot under any circumstances attach a database from a SQL Server 2008 server to a previous version like SQL Server 2005.

There is no way to achieve this - there's no "conversion" tool to change the database version or anything.

If you need to support SQL Server 2005, you have to have a SQL Server 2005 server at hand (maybe in a VM or something). Or then you need to use tools like Red Gate's SQL Compare and SQL Data Compare to synchronize changes between your SQL Server 2008 and your other SQL Server 2005 database.




回答2:


No, sorry. Recreate your database on the outdated SQL Server. Like most software, SQL Server only supports UPGRADES, not downgrades.




回答3:


It's not possible. You cannot attach/restore an SQL Server database to an earlier version of SQL Server I'm afraid. You have to do an export/import.




回答4:


No, you can not downgrade sql 2008 to sql 2005




回答5:


¿Do you know any tool that generate a "package" with data and structure that is compatible for SQL Server versions from 2000 to 2008? A tool or a Script, perhaps.

Old post. I am adding 2 suggestions for the sake of futures readers. New T-SQL features (syntax) cannot be back-ported (of course), but for simple scenarios (where every table has a primary key) you can temporarily set up and use transactional replication. You can also write a script that will BCP OUT every table's data (I suggest /native mode), perhaps using sp_MSForEachTable for that BCP command - this is essentially what replication's snapshot process does.




回答6:


i have same problem but there is a way for achieving to this issue:

  • attach a Database from Server 2008(or higher) to a SQL Server 2005(or 2000)

from a higher SQL version generate a Script (right click on your database > Task > Generate scripts ) then on SQL lower version create a raw database (by the same name) and run your script.

  • you have option to generate all data(or just create tables - store procdure-user-functions , ...) and then imported to SQL lower version database

I test this solution for SQL 2012 to SQL 2005. Except the new functions that developed for SQL higher version Every Schema & data generate to .sql file and then imported to lower SQL



来源:https://stackoverflow.com/questions/3147172/change-sql-server-database-version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!