SQL Server version error while attaching a mdf file

前端 未结 2 1724
长情又很酷
长情又很酷 2021-01-29 00:06

TITLE: Microsoft SQL Server Management Studio

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

ADDITIONAL

相关标签:
2条回答
  • 2021-01-29 00:45

    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.

    0 讨论(0)
  • 2021-01-29 00:50

    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;
    
    0 讨论(0)
提交回复
热议问题