Deleting Custom Databases
Scenarios
You can use a stored procedure to delete a custom database.
Prerequisites
An RDS Microsoft SQL Server DB instance has been connected. For details about how to connect to a DB instance, see Connecting to a DB Instance Through a Public Network.
Constraints
- This stored procedure cannot be used to delete system databases. If you attempt to delete a system database, the system displays the following information:
Error DBName can not in ('msdb','master','model','tempdb','rdsadmin','resource') .
- The stored procedure cannot be used to delete a database that does not exist. If you attempt to delete a database that does not exist, the system displays the following information:
Cannot find database XXX.
Procedure
Run the following command to delete a custom database:
EXEC rdsadmin.dbo.rds_drop_database '@DBName';
In the preceding command, @DBName indicates the name of the database to be deleted.
For example, to delete custom database testDB_1, run the following command:
EXEC rdsadmin.dbo.rds_drop_database 'testDB_1';
Last Article: Granting Database Permissions to Subaccounts
Next Article: Updating Database Statistics
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.