0

Having issues restoring a database in SSMS, error 38.

The databases are transferred up to google via their Drive API.

Download it on my side and has error.

If I transfer it through teamviewer from client PC I still get the same error.

Only happening on two clients the rest are fine.

I have tried backing up with FORMAT options and WITH CHECKSUM. Both succeed and backup is taking when verifying.

I have ran restore fileheaders only and get proper data except the physicalname path has a lowercase 'c' for the drive on the problem databases.

I have read this could be a corrupt database but I don't understand how the checksum and verify sql functions pass if so. Any insight would really help.

This is the backup command used in C#

"BACKUP DATABASE " + database + " TO DISK = '" 
+ database + "_" + dateTime.ToString("yyyy_MM_dd_HH") + 
"_CloudBackup.bak' WITH NAME = 'database', INIT, CHECKSUM"

EDIT: Running dbcc check on the database produced no errors. I have tried updated the physical name of the .mdf and .ldf it does not work still. Taking a backup from SSMS produces a valid backup file. It has something to do with the services I wrote.

EDIT 2: I am restoring through SSMS GUI. I have also tried RESTORE DATABASE db_name FROM 'backup_path'

Commands

RESTORE VERIFYONLY FROM DISK = 'backup_path'

On both computers, mine and the server PC yields "The backup set on file 1 is valid."

RESTORE FILELISTONLY FROM DISK = 'backup_path'

Have only test on my PC. Returns paths to mdf and ldf, no errors.

Both PCs have sql server 2012 (SP1)

migrated from stackoverflow.com Jul 24 at 10:24

This question came from our site for professional and enthusiast programmers.

  • 1
    Try running CHECKDB on the source server. – Alex Jul 24 at 5:35
  • @Alex I will try this when the clients get in today. Thank you for the suggestion. – Austen Swanson Jul 24 at 12:12
  • @Alex I have tried running checkdb and it produced no errors. Thank you for the suggestion though. – Austen Swanson Jul 26 at 16:47
  • 1
    @AustenSwanson You don't show the code you're using to restore the database. If you load up SSMS on the "problem" server, or another server, and execute RESTORE VERIFYONLY FROM DISK='<Your backup name here>.bak' do you still get the same error? Also, are the backup and restore servers running the exact same version of SQL Server? – AlwaysLearning Jul 27 at 10:13
  • @AlwaysLearning Thanks for the response. I added another edit to clarify some of your questions. – Austen Swanson Jul 29 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.