What are the challenges you face when working across database platforms? Take the survey

SQL Backup Error Messages

DBNewbie_2007DBNewbie_2007 Posts: 47 Bronze 3
edited July 8, 2020 11:57AM in SQL Backup
We recently had an interesting problem. We have a script to restore a lot of backups onto a secondary server. One of the steps is to capture the information about the backup file, i.e., 

<div>DECLARE @SQL VARCHAR(max),&nbsp;@FileName NVARCHAR(200);

</div><div>SET @FileName = '\\MyServerUNC\Backups\Jul2020\MyBackup18_FULL_20200705.sqb'

</div><div>SET @SQL = ' -sql "RESTORE FILELISTONLY FROM DISK = '''+@FileName+'''" '

</div><div>EXEC master..sqlbackup @SQL</div>

which produced the following error(s): 

Reading filelist of "\\MyServerUNC\Backups\Jul2020\MyBackup18_FULL_20200705.sqb"

Warning 485: File does not exist: \\MyServerUNC\Backups\Jul2020\MyBackup18_FULL_20200705.sqb
Error 530: File is missing or not accessible:  (\\MyServerUNC\Backups\Jul2020\MyBackup18_FULL_20200705.sqb)

SQL Backup exit code: 530

Turns out the DBA created a path using the full month name, July, not the 3-character month name (Jul), which is what is typically used for storing the historical backups. 

He asked an interesting question to which I could not provide an answer: 
"Why wouldn't the error just say 'invalid file path'"? 
which is a valid question. 

So... why did we not receive an error code 525 (Folder does not exist. Folder name: <value>) instead of codes 485/530?
FYI, we currently have SQL Backup Pro version installed. 


Sign In or Register to comment.