Rename Database Using MS SQL Management Studio
> First of all Open MS SQL Management Studio And Select your database.
> For Renaming a database,
Right Click on the database Icon and select
Rename.
> Suggest a New Name for your database and press enter.
> By this way we can
Rename a database usng Management Studio.
Rename Database Using Code (SQL Script)
> You have two option when
Renaming Database using code.
>
One is by using Alter Command and another is using Stored Procedure
sp_renameDB.
> Alter Command looks likes as follows
>
Alter database CurrentDatabaseName Modify Name = NewDatabaseName.
> By Executing the above code we can
Rename the Database.
>
Second way is by using
Stored Procedure sp_renameDB.
>
Execute sp_renameDB 'CurrentDatabaseName' , 'NewdatabaseName'.
> By Executing the above
Stored Procedure, we can
Rename the Database.
Watch Video of this Content on Video Streaming