Microsoft SQL Server 2016
You can not restore a 2019 database on a lower SQL Server version like here 2016, that's impossible and cause the error you got.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello community
I just started learning SQL and I am already facing a problem. When I try to restore the database it keeps appearing this error and I can't import the database., as you can see in the image.
Do you have some idea how can I solve it??
Microsoft SQL Server 2016
You can not restore a 2019 database on a lower SQL Server version like here 2016, that's impossible and cause the error you got.
I don't know why Alberto is talk about Azure. To me it seems that you are trying to restore the backup on your laptop.
The message makes me think that the backup file has been damaged somehow. But try this command:
RESTORE DATABASE AdventureWorks2019 FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL.15.SQLEXPRESS\MSSQL\Backup\AdventureWorks2019.bak'
WITH MOVE 'AdventureWorks2019' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.15.SQLEXPRESS\MSSQL\Data\AdventureWorks2019.mdf',
MOVE 'AdventureWorks2019_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.15.SQLEXPRESS\MSSQL\Data\AdventureWorks2019.ldf'
Maybe you get some error messages that gives us more information.
backup media verification failed
run the following code to verify the backup is not corrupted:
RESTORE VERIFYONLY FROM DISK = 'D:\AdventureWorks.bak';
GO
about possible media errors:
https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/possible-media-errors-during-backup-and-restore-sql-server?view=sql-server-ver15
and try to disable checksums during a restore operation
RESTORE DATABASE AdventureWorks2012
FROM DISK = 'Z:\SQLServerBackups\AdvWorksData.bak'
WITH NO_CHECKSUM;
GO
if backup file is really corrupted, you can use DBCC CHECKDB
repair: https://learn.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-transact-sql?view=sql-server-ver15
-------------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hello,
Thank you for the help.
So, I tried all the steps above, and I still can't work with the 'AdventureWorks2019'. But I tried to import the 'AdventureWorks2012' just to see what happens and it worked just fine and I'm now doing the course with that database.
Which SQL Server version are you using? You get the info with
select @@version