How to Rename a Database

If you ever need to rename a database, I recommend using the following script. It ensures no other users are connected. This is important, otherwise your connection won’t be able to gain a lock. I hope that helps!