Skip to content

Instantly share code, notes, and snippets.

@greggnakamura
Created November 12, 2019 21:21
Show Gist options
  • Save greggnakamura/6589ed829a3d4005f71a44ae41d1d08a to your computer and use it in GitHub Desktop.
Save greggnakamura/6589ed829a3d4005f71a44ae41d1d08a to your computer and use it in GitHub Desktop.
SQL Server: Rename DB with alter and rename
USE [master]
alter database exeterHospital
set single_user with rollback immediate;
Go
alter database exeterHospital modify name = exeterHospital_prep_for_9_to_10_upgrade
GO
alter database exeterHospital_prep_for_9_to_10_upgrade set multi_user
Go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment