Alter-Rename SQL Server Database Using Management Studio or Query

Alter-Rename SQL Server Database Using Management Studio or Query

Hi friends, in this post we will learn how to Alter-Rename SQL Server Database Using Management Studio or Query. Sometime we have a requirement of changing database name, we can do it by two ways. Using SQL Server management studio and Query. We will demonstrate you both ways.

In earlier post we have discussed how to create database in SQL Server link: How To Create Database in SQL Server.

SQL Server Management Studio:

Scenario: Here we have a database named: Test, we have to rename it to Hightechnology.

Right click on database name: Test, and click on Rename > now you can change name of your database.

Alter-Rename SQL Server Database Using Management Studio or Query

Using Query:

QUERY 1:

ALTER DATABASE TEST MODIFY NAME= HIGHTECHNOLOGY

Result:
ALTER DATABASE USING QUERY IN SQL SERVER

QUERY 2:

DROP DATABSE TEST

Result:
 ALTER DATABASE USING QUERY IN SQL SERVER Stored procedure

Note: If you are getting any error in changing database name, restart SQL Server services and then try again.