Restore Sql Server Database from backup in Azure
-
19-10-2022 - |
Question
http://technet.microsoft.com/en-us/library/jj919148.aspx
In the above link it is well explained how to restore a Sql Server db from a backup file stored as a blob in Azure: the paragraph is "Restore a database and move files" for the language C#.
The lines
restore.RelocateFiles.Add(new RelocateFile(dbName, newDataFilePath));
restore.RelocateFiles.Add(new RelocateFile(dbName+ "_Log", newLogFilePath));
map the logical names of the db files to physical paths. But the problem with this is that the logical names are not always the same as the dbName. The logical names are usually found this way:
RESTORE FILELISTONLY
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\MyDatabaseBackup.bak'
GO
Is it possible to find the logical names in such a way, from the backup stored in Azure?
Thanks a lot for any suggestion.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow