Skip to content

Latest commit

 

History

History
85 lines (54 loc) · 3.51 KB

File metadata and controls

85 lines (54 loc) · 3.51 KB
description Increase the Size of a Database
title Increase the Size of a Database | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology
ms.topic conceptual
helpviewer_keywords
databases [SQL Server], size
increasing database size
database size [SQL Server], increasing
size [SQL Server], databases
ms.assetid 14f4206d-3afa-4ba9-9849-23e81d63306d
author WilliamDAssafMSFT
ms.author wiassaf
monikerRange >=sql-server-2016||>=sql-server-linux-2017

Increase the Size of a Database

[!INCLUDE SQL Server]

This topic describes how to increase the size of a database in [!INCLUDEssnoversion] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql]. The database is expanded by either increasing the size of an existing data or log file or by adding a new file to the database.

In This Topic

Before You Begin

Limitations and Restrictions

  • You cannot add or remove a file while a BACKUP statement is running.

Security

Permissions

Requires ALTER permission on the database.

Using SQL Server Management Studio

To increase the size of a database

  1. In Object Explorer, connect to an instance of the [!INCLUDEssDEnoversion], and then expand that instance.

  2. Expand Databases, right-click the database to increase, and then click Properties.

  3. In Database Properties, select the Files page.

  4. To increase the size of an existing file, increase the value in the Initial Size (MB) column for the file. You must increase the size of the database by at least 1 megabyte.

  5. To increase the size of the database by adding a new file, click Add and then enter the values for the new file. For more information, see Add Data or Log Files to a Database.

  6. Click OK.

Using Transact-SQL

To increase the size of a database

  1. Connect to the [!INCLUDEssDE].

  2. From the Standard bar, click New Query.

  3. Copy and paste the following example into the query window and click Execute. This example increases the size of the file test1dat3.

[!code-sqlDatabaseDDL#AlterDatabase5]

For more examples, see ALTER DATABASE File and Filegroup Options (Transact-SQL).

See Also

Add Data or Log Files to a Database
Shrink a Database