O'Reilly logo

Microsoft® SQL Server™ 2005 Administrator's Pocket Consultant by William R. Stanek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required