I am creating a program which detaches a database.
How can I check to see whether or not the stored procedure has run without errors so I can confirm to the user it is fully finished.
I'm using a try catch
around the execution, but i'm not 100% certain this will return all internal errors?
My concern is that if I write:
try
{
cmd.ExecuteNonQuery();
MessageBox.Show("it has finished");
}
catch (exception ex)
{
ex.ToString();
}
Isn't reliable
my Command:
return "sp_detach_db '" + dbType[db] + "', 'true'";