Showing posts with label Rename database MSSQL server. Show all posts
Showing posts with label Rename database MSSQL server. Show all posts

Thursday, August 4, 2022

How to rename a database in the MS SQL server:


Use the below code to rename a database in the MS SQL server - 

USE master; GO ALTER DATABASE Database01 SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO ALTER DATABASE Database01 MODIFY NAME = Database02 ; GO ALTER DATABASE Database02 SET MULTI_USER GO