Site icon IT Tutorial

SQL Server Change Database Name

Hi,

Especially during the creation of Test environment, you may need changing database name as SQL Server DBA.

 

You don’t want to delete old database after creation of Test environment , perhaps you may need to see old database data. So you can change old database name to new name.

You can change database name using following query.

 

Take database to single_user mode.

 

alter database MehmetSalih set single_user with rollback immediate;

 

Change database name like following

exec sp_renamedb 'MehmetSalih', 'Deveci';

 

then take database to multi_user mode.

alter database Deveci set multi_user with rollback immediate;

 

Do you want to learn Microsoft SQL Server DBA Tutorials for Beginners, then read the following articles.

https://ittutorial.org/sql-server-tutorials-microsoft-database-for-beginners/

Exit mobile version