• So, if already exists, it will not return anything from the second sql. Because you are checking for not exists?

    I thought that you want the path for Master DB only if the Test_Restore doesn't exist.