MS SQL - How to rename database name

By xngo on September 2, 2021

  1. Take the database offline and then bring it back online so that all connections to the database are dropped: Right-click on database name > Tasks > Take Offline.
    Right-click on database name > Tasks > Take Offline
  2. Rename the database. Database name convention is "Names can contain only alphanumeric characters and must begin with an alphabetic character or an underscore (_). Database names must begin with an alphabetic character, and cannot begin with an underscore.".

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.