How to Rename a Database in SQL Server | Step-by-Step Tutorial

Опубликовано: 21 Март 2026
на канале: parvesh
31
0

In this video, you will learn the correct and safe methods to rename a database in SQL Server using both SQL Server Management Studio (SSMS) and T-SQL commands.
You’ll also understand when renaming a database can cause issues and the steps to avoid common errors.

TSQL Commands Used :

ALTER DATABASE OLDDATABASENAME SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO

ALTER DATABASE OLDDATABASENAME MODIFY NAME = NEWDATABASENAME;
GO

ALTER DATABASE NEWDATABASENAME SET MULTI_USER;
GO

👉 What you will learn

How to rename a database in SQL Server
Rename database using SSMS
Rename database using T-SQL
The correct script using ALTER DATABASE
How to disconnect active connections
Common errors and how to fix them

Tags:
SQL coding tutorial india
SQL programming tutorial hindi
SQL server tutorial
SQL beginner programming guide
SQL tech tutorial youtube