且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有什么理由在同一台计算机上安装SQL Server 2005和2008?

更新时间:2022-12-25 12:01:40

我实际上没有尝试过将2005年的数据库迁移到2008年,但通常SQL可以毫不费力地轻松地进行处理。最简单的方法是从SQL 2005备份数据库,然后使用SQL 2008还原该备份。

I haven't actually tried migrating a 2005 database to 2008, but generally SQL handles this cleanly and without difficulty. The simplest way to do it would be to make a backup of your database from SQL 2005 and then restore that backup with SQL 2008.

如果要保留SQL 2005到处复制并联机复制,直到您知道2008年的副本有效为止,将备份还原到2008年时,您可能需要将数据库的数据/日志文件移动,因为旧的数据文件将在2005年使用。您可以执行此操作使用恢复数据库带移动选项,例如:

If you want to keep the SQL 2005 copy around and online until you know that the 2008 copy is working, you might need to move the data/log files for your database when restoring the backup onto 2008, since the old data files will be in use by 2005. You can do this using the with move option of restore database, for example:

从磁盘='c:\backupfile.bak'恢复数据库mydb

并移动'maindatafile'到'c:\newdatalocation.mdf',

MOVE'mainlogfile'到'c:\newloglocation.ldf'

关于同时安装它们,您可能决定执行此操作的一个原因是,如果您打算让您的软件支持与这两个版本进行通信,则可以简化针对这两个版本的代码测试工作。

As to having both installed at the same time, one reason you might decide to do this would be to simplify the job of testing code against both versions, if you were intending to have your software support talking to both versions.