How to alter database name in sql server?
1 answer(s)
Answer # 1 #
Renaming a SQL Server DatabaseTo change a database name in SQL Server, use this T-SQL command:sqlALTER DATABASE OldName MODIFY NAME = NewName;
Steps:1. Open SQL Server Management Studio (SSMS).2. Connect to your server.3. Run the above command, replacing OldName
and NewName
.4. Verify by checking the database list.Note: Ensure the database isn’t in use. For details, see Microsoft Docs.— DBAdmin