Skip to content

Instantly share code, notes, and snippets.

@sayham-sjb
Last active September 13, 2019 18:59
Show Gist options
  • Save sayham-sjb/73edf0861e6c05824a83846d51ed1d76 to your computer and use it in GitHub Desktop.
Save sayham-sjb/73edf0861e6c05824a83846d51ed1d76 to your computer and use it in GitHub Desktop.
Error Database already in use when trying to restore backup #sql
--Set offline and rollback
ALTER DATABASE {DBName} SET OFFLINE WITH ROLLBACK IMMEDIATE
--Then SET it online
ALTER DATABASE {DBName} SET ONLINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment