Manipulating Databases
Other core administration tasks include renaming, dropping, detaching, copying, and moving databases. These tasks are examined in this section.
Renaming a Database
You can rename user databases in SQL Server Management Studio and with the ALTER DATABASE MODIFY NAME statement. With the database in single-user or offline mode, right-click the database name in SQL Server Management Studio and select Rename from the shortcut menu. Then type the database name and press Tab.
To use T-SQL to put the database in single-user mode and change the name, complete the following steps:
Ask all users to disconnect from the database. Make sure that all SQL Server Management Studio connections to the database are closed. If necessary, kill the ...
Get Microsoft® SQL Server™ 2005 Administrator's Pocket Consultant now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.