Use SMO to find backup file for recovery

I can use SMO to create a tree view similar to the Search Backup File dialog from SSMS. I can list the folders on the server, and if there are backup devices, they will also be listed. One thing that I cannot reproduce is how to look for a backup file for recovery that was not originally copied from the server (therefore it is not in the list of backup devices).

I am looking for something like this screenshot of the SSMS dialog: SSMS Locate Backup File Dialog

Is there an EnumServerFiles method similar to Server.EnumDirectories ()?

Keep in mind that this may work with SQL Server, which is not a local machine (network server).

+3
1

SMO , .

: :

 exec xp_dirtree 'c:\sqlbackups\', 1, 1
+5

Source: https://habr.com/ru/post/1730002/


All Articles