I'm not sure I completely understand the question, but if I'm not mistaken the RESTORE command automatically checks to see if the database exists and does not overwrite it if it does. (unless you specify the REPLACE keyword).
So the restore would generate an error that you could trap if you tried to restore a database with a name that already exists.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.