Is there a view or a property of Microsoft.SqlServer.Management.Smo that'll tell me if a database is already fully recovered?
I'm running a command in powershell to put my database back in recovery mode... however if the database is already fully recovered I get the "The database is already fully recovered" exception...
So what I want is:
Your help on determining Database_Is_Already_Recovered is much appreciated
I'm running a command in powershell to put my database back in recovery mode... however if the database is already fully recovered I get the "The database is already fully recovered" exception...
So what I want is:
Code:
if (NOT Database_Is_Already_Recovered)
{
RESTORE DATABASE $targetDBName WITH RECOVERY
}
Your help on determining Database_Is_Already_Recovered is much appreciated