Viewing, Renaming and Deleting a Database
Previous Home Next

Viewing a Database

The information regarding database such as owner, size, date of creation, and status can be viewed using the following:

sp_helpdb database_name


sp_helpdb aditya


Renaming Database

The name of database can be changed. The database should not be in use when it is being renamed, and it should be set to the single-user mode.

sp_rename 'old_name','new_name' 

where, old_name is the original name of the database

new_name is the original name of the database

Only system administrator can changed the name of a database.

Deleting a Database

A database is deleted when it is no longer required. Only the system administrator and database owner have permission to delete a database.

DROP DATABASE  database_name

where, database_name is the name of the database

Previous Home Next