Database restore error: The specified conversion is not valid. (Sqlmanagerui)

Source: Internet
Author: User

SSMs is somewhat convenient for us to do some common things. But sometimes it's not so impersonal. In particular, error messages.

Today, I encountered an error while doing a database restore: The specified conversion is not valid. (Sqlmanagerui)

Specified cast is not valid. (Sqlmanagerui)

No way, have to hit the code:

RESTORE  from DISK = N'D:\XXDB. BAK'GO

What you see is this:

It turns out that it was encrypted when it was backed up. Encryption is encrypted, actually reported the conversion invalid error .....

Restore success with script after finding the password:

RESTOREFilelistonly from DISK =N'D:\XXDB. BAK'   withPASSWORD= 'MyPassword'RESTORE DATABASE [XXDB2]  from DISK =N'D:\XXDB. BAK'  with  FILE = 1, MOVE N'Xxdb'  toN'D:\MSSQL\DATA\XXDB2.mdf', MOVE N'Xxdata'  toN'D:\MSSQL\DATA\XXDB2_1.NDF', MOVE N'Xxdb_log'  toN'D:\MSSQL\DATA\XXDB2_2.ldf', Norecovery,stats= Ten, PASSWORD= 'MyPassword'GO
--recover the database:
RESTORE DATABASE [XXDB2] with RECOVERY;
GO

Database restore error: The specified conversion is not valid. (Sqlmanagerui)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.