Altering a Database

You can use the ALTER DATABASE command to change a database’s definition in one of the following ways:

  • Change the name of the database.

  • Add one or more new data files to the database. If you want, you can put these files in a user-defined filegroup. All files added in a single ALTER DATABASE command must go in the same filegroup.

  • Add one or more new log files to the database.

  • Remove a file or a filegroup from the database. You can do this only if the file or filegroup is completely empty. Removing a filegroup removes all the files in it.

  • Add a new filegroup to a database. (Adding files to those filegroups must be done in a separate ALTER DATABASE command.)

  • Modify an existing file in one of the following ways:

    • Increase the value of ...

Get Microsoft® SQL Server® 2008 Internals 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.