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
@@ -299,7 +299,7 @@ When set to `ON`, it creates a ledger database, in which the integrity of all us
299
299
300
300
Specifies that the database is created by [attaching](../../relational-databases/databases/database-detach-and-attach-sql-server.md) an existing set of operating system files. There must be a \<filespec> entry that specifies the primary file. The only other \<filespec> entries required are those for any files that have a different path from when the database was first created or last attached. A \<filespec> entry must be specified for these files.
301
301
302
-
FOR ATTACH requires the following:
302
+
FOR ATTACH requires:
303
303
304
304
- All data files (MDF and NDF) must be available.
305
305
- If multiple log files exist, they must all be available.
@@ -309,9 +309,9 @@ If a read/write database has a single log file that is currently unavailable, an
309
309
> [!NOTE]
310
310
> A database created by a more recent version of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] cannot be attached in earlier versions.
311
311
312
-
In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], any full-text files that are part of the database that is being attached will be attached with the database. To specify a new path of the full-text catalog, specify the new location without the full-text operating system file name. For more information, see the Examples section.
312
+
In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], any full-text files that are part of the database that is being attached will be attached with the database. To specify a new path of the full-text catalog, specify the new location without the full-text operating system file name. For more information, see [Examples](#examples).
313
313
314
-
Attaching a database that contains a FILESTREAM option of "Directory name", into a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]instance will prompt [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]to verify that the Database_Directory name is unique. If it is not, the `ATTACH` operation fails with the error, `FILESTREAM Database_Directory name is not unique in this SQL Server instance`. To avoid this error, the optional parameter, *directory_name*, should be passed in to this operation.
314
+
Attaching a database that contains a FILESTREAM option of "Directory name" prompts [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] to verify that the `Database_Directory` name is unique. If it is not, the `ATTACH` operation fails with the error, `FILESTREAM Database_Directory name is not unique in this SQL Server instance`. To avoid this error, the optional parameter, *directory_name*, should be passed in to this operation.
315
315
316
316
FOR ATTACH cannot be specified on a database snapshot.
317
317
@@ -365,7 +365,7 @@ FOR ATTACH_REBUILD_LOG requires the following conditions:
365
365
- All data files (MDF and NDF) must be available.
366
366
367
367
> [!IMPORTANT]
368
-
> This operation breaks the log backup chain. We recommend that a full database backup be performed after the operation is completed. For more information, see [BACKUP](../../t-sql/statements/backup-transact-sql.md).
368
+
> This operation breaks the log backup chain. We recommend that you take a full database backup immediately after the operation is completed. For more information, see [BACKUP](../../t-sql/statements/backup-transact-sql.md).
369
369
370
370
Typically, FOR ATTACH_REBUILD_LOG is used when you copy a read/write database with a large log to another server where the copy will be used mostly, or only, for read operations, and therefore requires less log space than the original database.
371
371
@@ -491,7 +491,7 @@ Is the name of the new database snapshot. Database snapshot names must be unique
491
491
492
492
#### ON ( NAME =_logical_file_name_, FILENAME ='_os_file_name_') [ ,... *n*]
493
493
494
-
For creating a database snapshot, specifies a list of files in the source database. For the snapshot to work, all the data files must be specified individually. However, log files are not allowed for database snapshots. FILESTREAM filegroups are not supported by database snapshots. If a FILESTREAM data file is included in a CREATE DATABASE ON clause, the statement will fail and an error will be raised.
494
+
For creating a database snapshot, specifies a list of files in the source database. For the snapshot to work, all the data files must be specified individually. However, log files are not allowed for database snapshots. FILESTREAM filegroups are not supported by database snapshots. If a FILESTREAM data file is included in a `CREATE DATABASE``ON` clause, the statement fails and an error will be raised.
495
495
496
496
For descriptions of NAME and FILENAME and their values, see the descriptions of the equivalent \<filespec> values.
497
497
@@ -739,7 +739,7 @@ GO
739
739
740
740
### E. Attach a database
741
741
742
-
The following example detaches the database `Archive` created in example D, and then attaches it by using the `FOR ATTACH` clause. `Archive` was defined to have multiple data and log files. However, because the location of the files has not changed since they were created, only the primary file has to be specified in the `FOR ATTACH` clause. Beginning with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)], any full-text files that are part of the database that is being attached will be attached with the database.
742
+
The following example detaches the database `Archive` created in example D, and then attaches it by using the `FOR ATTACH` clause. `Archive` was defined to have multiple data and log files. However, because the location of the files has not changed since they were created, only the primary file has to be specified in the `FOR ATTACH` clause. Beginning with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)], any full-text files that are part of the database that is being attached are attached with the database.
Specifies how the point-in-time restore and long-term retention backups for a database are replicated. Geo restore or ability to recover from regional outage is only available when database is created with `GEO` backup storage redundancy. Unless explicitly specified, databases created with T-SQL use geo-redundant backup storage.
1072
1074
1075
+
Use `GEOZONE` for geo-zone redundant storage. Geo-zone redundant storage (GZRS) offers the highest level of protection against zonal outages as well as regional outages for any workload.
1076
+
1073
1077
To enforce data residency when you're creating a database by using T-SQL, use `LOCAL` or `ZONE` as input to the BACKUP_STORAGE_REDUNDANCY parameter.
1074
1078
1075
1079
When creating a database as a copy of another database with `AS COPY OF`, specifying options is supported and should be wrapped in parentheses. For example, `WITH (BACKUP_STORAGE_REDUNDANCY = 'LOCAL');`.
@@ -1182,7 +1186,7 @@ To change the size, edition, or service objective values later, use [ALTER DATAB
1182
1186
1183
1187
Copying a database using the `CREATE DATABASE` statement is an asynchronous operation. Therefore, a connection to the [!INCLUDE[ssSDS](../../includes/sssds-md.md)] server is not needed for the full duration of the copy process. The `CREATE DATABASE` statement returns control to the user after the entry in `sys.databases` is created but before the database copy operation is complete. In other words, the `CREATE DATABASE` statement returns successfully when the database copy is still in progress.
1184
1188
1185
-
- Monitoring the copy process on an [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)] server: Query the `percentage_complete` or `replication_state_desc` columns in the [dm_database_copies](../../relational-databases/system-dynamic-management-views/sys-dm-database-copies-azure-sql-database.md) or the `state` column in the **sys.databases** view. The [sys.dm_operation_status](../../relational-databases/system-dynamic-management-views/sys-dm-operation-status-azure-sql-database.md) view can be used as well as it returns the status of database operations including database copy.
1189
+
- Monitoring the copy process on an [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)] server: Query the `percentage_complete` or `replication_state_desc` columns in the [dm_database_copies](../../relational-databases/system-dynamic-management-views/sys-dm-database-copies-azure-sql-database.md) or the `state` column in the `sys.databases` view. The [sys.dm_operation_status](../../relational-databases/system-dynamic-management-views/sys-dm-operation-status-azure-sql-database.md) view can be used as well as it returns the status of database operations including database copy.
1186
1190
1187
1191
At the time the copy process completes successfully, the destination database is transactionally consistent with the source database.
1188
1192
@@ -1404,7 +1408,7 @@ The following are `CREATE DATABASE` limitations:
1404
1408
1405
1409
## Permissions
1406
1410
1407
-
To create a database, a login must be one of the following:
1411
+
To create a database, a login must be one of the following types of security principals:
1408
1412
1409
1413
- The server-level principal login
1410
1414
- The Microsoft Entra administrator for the [logical server in Azure](/azure/azure-sql/database/logical-servers)
Databases are created with database compatibility level 120, which is the compatibility level for [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)]. This ensures that the database will be able to use all of the [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)] functionality that PDW uses.
1692
1697
1693
-
## Limitations and Restrictions
1698
+
<aid="limitations-and-restrictions"></a>
1699
+
1700
+
## Limitations
1694
1701
1695
1702
The CREATE DATABASE statement is not allowed in an explicit transaction. For more information, see [Statements](../../t-sql/statements/statements.md).
1696
1703
@@ -1714,7 +1721,7 @@ After this operation succeeds, an entry for this database will appear in the [sy
1714
1721
1715
1722
### A. Basic database creation examples
1716
1723
1717
-
The following example creates the database `mytest` with a storage allocation of 100 GB per Compute node for replicated tables, 500 GB per appliance for distributed tables, and 100 GB per appliance for the transaction log. In this example, AUTOGROW is off by default.
1724
+
The following example creates the database `mytest` with a storage allocation of 100 GB per Compute node for replicated tables, 500 GB per appliance for distributed tables, and 100 GB per appliance for the transaction log. In this example, `AUTOGROW` is off by default.
1718
1725
1719
1726
```sql
1720
1727
CREATEDATABASEmytest
@@ -1724,7 +1731,7 @@ CREATE DATABASE mytest
1724
1731
LOG_SIZE =100 GB );
1725
1732
```
1726
1733
1727
-
The following example creates the database `mytest` with the same parameters as above, except that AUTOGROW is turned on. This allows the database to grow outside the specified size parameters.
1734
+
The following example creates the database `mytest` with the same parameters, except that `AUTOGROW` is turned on. This allows the database to grow outside the specified size parameters.
0 commit comments