You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/t-sql/statements/backup-transact-sql.md
+23-12Lines changed: 23 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: BACKUP (Transact-SQL) backs up a SQL database.
4
4
author: MikeRayMSFT
5
5
ms.author: mikeray
6
6
ms.reviewer: dinethi, wiassaf, randolphwest
7
-
ms.date: 08/15/2025
7
+
ms.date: 03/02/2026
8
8
ms.service: sql
9
9
ms.subservice: t-sql
10
10
ms.topic: reference
@@ -489,11 +489,11 @@ The ZSTD compression algorithm is available starting with [!INCLUDE [sssql25-md]
489
489
490
490
| Backup statement | Outcome |
491
491
| --- | --- |
492
-
|**BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH NO_COMPRESSION**| Backup without any compression |
493
-
|**BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION**| Backup with compression using the algorithm specified by the server option `backup compression algorithm` (default `MS_XPRESS`) |
494
-
|**BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION (ALGORITHM = MS_XPRESS)**| Backup with compression using `MS_XPRESS` algorithm |
495
-
|**BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION (ALGORITHM = ZSTD)**| Backup with compression using ZSTD algorithm. |
496
-
|**BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION (ALGORITHM = ZSTD, LEVEL = HIGH)**| Backup with compression using ZSTD algorithm with compression level `HIGH`. |
492
+
|`BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH NO_COMPRESSION`| Backup without any compression |
493
+
|`BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION`| Backup with compression using the algorithm specified by the server option `backup compression algorithm` (default `MS_XPRESS`) |
494
+
|`BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION (ALGORITHM = MS_XPRESS)`| Backup with compression using `MS_XPRESS` algorithm |
495
+
|`BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION (ALGORITHM = ZSTD)`| Backup with compression using ZSTD algorithm. |
496
+
|`BACKUP DATABASE *database_name* TO {DISK | TAPE | URL} WITH COMPRESSION (ALGORITHM = ZSTD, LEVEL = HIGH)`| Backup with compression using ZSTD algorithm with compression level `HIGH`. |
@@ -639,6 +639,13 @@ Specifies the largest unit of transfer in bytes to be used between [!INCLUDE [ss
639
639
640
640
When creating backups by using the SQL Writer Service, if the database has configured [FILESTREAM (SQL Server)](../../relational-databases/blob/filestream-sql-server.md), or includes [memory optimized filegroups](../../relational-databases/in-memory-oltp/the-memory-optimized-filegroup.md), then the `MAXTRANSFERSIZE` at the time of a restore should be greater than or equal to the `MAXTRANSFERSIZE` that was used when the backup was created.
641
641
642
+
| Command | SQL Server 2022 and later versions |
643
+
|:--|:--|:--|:--|
644
+
| BACKUP TO URL - Azure | Default 1 MB, Max 20 MB |
645
+
| BACKUP TO URL - S3 | Default 10 MB, Max 20 MB |
646
+
| BACKUP TO DISK | Default is 1 MB, Max 4 MB |
647
+
| BACKUP TO TAPE/VDI | Default 64 KB, Max 4 MB |
648
+
642
649
For [Transparent data encryption (TDE)](../../relational-databases/security/encryption/transparent-data-encryption.md) enabled databases with a single data file, the default `MAXTRANSFERSIZE` is 65536 (64 KB). For non-TDE encrypted databases, the default `MAXTRANSFERSIZE` is 1048576 (1 MB) when using backup to `DISK`, and 65536 (64 KB) when using VDI or `TAPE`. For more information about using backup compression with TDE encrypted databases, see the [Remarks](#remarks) section.
643
650
644
651
### Error management options
@@ -755,7 +762,7 @@ Specifies that the transaction log shouldn't be not truncated and causes the [!I
755
762
756
763
The `NO_TRUNCATE` option of `BACKUP LOG` is equivalent to specifying both `COPY_ONLY` and `CONTINUE_AFTER_ERROR`.
757
764
758
-
Without the `NO_TRUNCATE` option, the database must be in the `ONLINE` state. If the database is in the SUSPENDED state, you might be able to create a backup by specifying `NO_TRUNCATE`. But if the database is in the `OFFLINE` or `EMERGENCY` state, `BACKUP` isn't allowed even with `NO_TRUNCATE`. For information about database states, see [Database States](../../relational-databases/databases/database-states.md).
765
+
Without the `NO_TRUNCATE` option, the database must be in the `ONLINE` state. If the database is in the SUSPENDED state, you might be able to create a backup by specifying `NO_TRUNCATE`. But if the database is in the `OFFLINE` or `EMERGENCY` state, `BACKUP` isn't allowed even with `NO_TRUNCATE`. For information about database states, see [Database states](../../relational-databases/databases/database-states.md).
759
766
760
767
## About working with SQL Server backups
761
768
@@ -1365,7 +1372,11 @@ The total space used by the buffers is determined by: `BUFFERCOUNT * MAXTRANSFER
1365
1372
1366
1373
Specifies the largest unit of transfer in bytes to be used between [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] and the backup media. The possible values are multiples of 65536 bytes (64 KB) ranging up to 4,194,304 bytes (4 MB).
1367
1374
1368
-
For [Transparent data encryption (TDE)](../../relational-databases/security/encryption/transparent-data-encryption.md) enabled databases with a single data file, the default `MAXTRANSFERSIZE` is 65536 (64 KB). For non-TDE encrypted databases the default `MAXTRANSFERSIZE` is 1048576 (1 MB) when using backup to `DISK`, and 65536 (64 KB) when using VDI or `TAPE`.
1375
+
| Command | Azure SQL Managed Instance<BR><BR>SQL Server 2022 or SQL Server 2025 update policy | Azure SQL Managed Instance<BR><BR>Always-up-to-date policy |
1376
+
|:--|:--|:--|:--|
1377
+
| BACKUP TO URL - Azure | Dynamic, chosen by the service for automatic backups.<br><br>For COPY_ONLY backups: Default 1 MB, Max 100 MB | Dynamic, chosen by the service for automatic backups.<br><br>For COPY_ONLY backups: Default 1 MB, Max 100 MB|
1378
+
1379
+
For databases with [Transparent data encryption (TDE)](../../relational-databases/security/encryption/transparent-data-encryption.md) enabled with a single data file, the default `MAXTRANSFERSIZE` is 65536 (64 KB). For non-TDE encrypted databases the default `MAXTRANSFERSIZE` is 1048576 (1 MB) when using backup to `DISK`, and 65536 (64 KB) when using VDI or `TAPE`.
1369
1380
1370
1381
> [!NOTE]
1371
1382
> `MAXTRANSFERSIZE` specifies the largest unit of transfer, and doesn't guarantee that every write operation transfers the specified largest size.
@@ -1566,12 +1577,12 @@ For more information about managing credentials in [!INCLUDE [ssPDW](../../inclu
1566
1577
- The database doesn't exist.
1567
1578
- The target directory already exists on the network share.
1568
1579
- The target network share isn't available.
1569
-
- The target network share doesn't have enough space for the backup. The `BACKUP DATABASE` command doesn't confirm that sufficient disk space exists prior to initiating the backup, making it possible to generate an out-of-disk-space error while running `BACKUP DATABASE`. When insufficient disk space occurs, [!INCLUDE [ssPDW](../../includes/sspdw-md.md)] rolls back the `BACKUP DATABASE` command. To decrease the size of your database, run [DBCC SHRINKLOG](../database-console-commands/dbcc-shrinklog-azure-sql-data-warehouse.md)
1580
+
- The target network share doesn't have enough space for the backup. The `BACKUP DATABASE` command doesn't confirm that sufficient disk space exists prior to initiating the backup, making it possible to generate an out-of-disk-space error while running `BACKUP DATABASE`. When insufficient disk space occurs, [!INCLUDE [ssPDW](../../includes/sspdw-md.md)] rolls back the `BACKUP DATABASE` command. To decrease the size of your database, run [DBCC SHRINKLOG - Analytics Platform System (PDW)](../database-console-commands/dbcc-shrinklog-azure-sql-data-warehouse.md)
1570
1581
- Attempt to start a backup within a transaction.
1571
1582
1572
1583
## Remarks
1573
1584
1574
-
Before you perform a database backup, use [DBCC SHRINKLOG](../database-console-commands/dbcc-shrinklog-azure-sql-data-warehouse.md) to decrease the size of your database.
1585
+
Before you perform a database backup, use [DBCC SHRINKLOG - Analytics Platform System (PDW)](../database-console-commands/dbcc-shrinklog-azure-sql-data-warehouse.md) to decrease the size of your database.
1575
1586
1576
1587
A [!INCLUDE [ssPDW](../../includes/sspdw-md.md)] backup is stored as a set of multiple files within the same directory.
0 commit comments