SQL Server version error while attaching a mdf file

只谈情不闲聊 提交于 2021-02-17 05:36:03

问题


TITLE: Microsoft SQL Server Management Studio

Attach database failed for Server 'DESKTOP-MR6JCUA'. (Microsoft.SqlServer.Smo)

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)

The database 'ABC_Management_System' cannot be opened because it is version 869. This server supports version 852 and earlier. A downgrade path is not supported.
Could not open new database 'ABC_Management_System'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)


回答1:


Your Sql server 2016 database that you are importing into cannot load the Sql Server 2017 backup.

One Solution:

The SQL Utilities that create bacpac files with schema and data can accomplish this usually. You would be transferring the data from one sql server to the other. It would be a fancy copy operation that does not rely on the backup file. Pay attention to target and source if you do this.

Another Solution:

Upgrade your “2016” server to a 2017 server, but you should also consider installing a second 2017 Instance next to your 2016 instance if your 2016 target is a really a dev machine. Then you will be able to restore your original 2017 backup file into your new 2017 sql server instance.




回答2:


Please select Data source as .\sqlexpress intead of (localdb)\MSSQLLocalDB

For example, try to set the Database connection string as

Data Source=.\sqlexpress;AttachDbFilename=C:\\...\\XXX.mdf; Integrated Security=True;


来源:https://stackoverflow.com/questions/51334857/sql-server-version-error-while-attaching-a-mdf-file

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