Use original file paths when getting associated DB files (#2263)

This commit is contained in:
Cory Rivera
2023-10-04 13:44:29 -07:00
committed by GitHub
parent eb1116ce13
commit be8e3f4fe3

View File

@@ -14,7 +14,6 @@ using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using SMO = Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Management;
using System.IO;
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
{
@@ -376,12 +375,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
foreach (DataRow currentRow in dataTable.Rows)
{
var primaryFolder = Path.GetDirectoryName(primaryFilePath);
var originalPath = (string)currentRow["FileName"];
var originalFileName = Path.GetFileName(originalPath);
var filePath = Path.Join(primaryFolder, originalFileName);
var filePath = (string)currentRow["FileName"];
// Check if file exists with the constructed path.
// Check if file exists with the provided path.
// If it's an XI (XStore Integration) path, then assume it exists, otherwise retrieve info for the file to check if it exists.
var exists = true;
var isXIPath = PathWrapper.IsXIPath(primaryFilePath);