Skip to content

Commit 898a6b2

Browse files
authored
Merge pull request #26981 from MicrosoftDocs/main
5/4/2023 PM Publish
2 parents c059806 + d1728f2 commit 898a6b2

3 files changed

Lines changed: 59 additions & 46 deletions

File tree

azure-sql/database/database-copy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ CREATE DATABASE Database2 AS COPY OF server1.Database1 (SERVICE_OBJECTIVE = ELAS
144144
You can use the steps in the [Copy a SQL Database to a different server](#copy-to-a-different-server) section to copy your database to a server in a different subscription using T-SQL. Make sure you use a login that has the same name and password as the database owner of the source database. Additionally, the login must be a member of the `dbmanager` role or a server administrator, on both source and target servers.
145145

146146
> [!TIP]
147-
> When copying databases in the same Azure Active Directory tenant, authorization on the source and destination servers is simplified if you initiate the copy command using an AAD authentication login with sufficient access on both servers. The minimum necessary level of access is membership in the `dbmanager` role in the `master` database on both servers. For example, you can use an AAD login is a member of an AAD group designated as the server administrator on both servers.
147+
> When copying databases in the same Azure Active Directory tenant, authorization on the source and destination servers is simplified if you initiate the copy command using an AAD authentication login with sufficient access on both servers. The minimum necessary level of access is membership in the `dbmanager` role in the `master` database on both servers. For example, you can use an AAD login that is a member of an AAD group designated as the server administrator on both servers.
148148
149149
```sql
150150
--Step# 1

docs/relational-databases/databases/view-a-database-snapshot-sql-server.md

Lines changed: 57 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: "View a Database Snapshot (SQL Server)"
33
description: Learn how to view a SQL Server database snapshot using SQL Server Management Studio or Transact-SQL.
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
6-
ms.date: "03/14/2017"
6+
ms.reviewer: pijocoder
7+
ms.date: 05/04/2023
78
ms.service: sql
89
ms.subservice: supportability
910
ms.topic: conceptual
@@ -13,47 +14,59 @@ helpviewer_keywords:
1314
- "viewing database snapshots"
1415
---
1516
# View a Database Snapshot (SQL Server)
16-
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
17-
This topic explains how to view a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database snapshot using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
18-
17+
18+
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
19+
20+
This article explains how to view a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database snapshot using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
21+
1922
> [!NOTE]
20-
> To create, revert to, or delete a database snapshot, you must use [!INCLUDE[tsql](../../includes/tsql-md.md)].
21-
22-
**In This Topic**
23-
24-
- **To view a database snapshot, using:**
25-
26-
[SQL Server Management Studio](#SSMSProcedure)
27-
28-
[Transact-SQL](#TsqlProcedure)
29-
30-
## <a name="SSMSProcedure"></a> Using SQL Server Management Studio
31-
**To view a database snapshot**
32-
33-
1. In Object Explorer, connect to the instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] and then expand that instance.
34-
35-
2. Expand **Databases.**
36-
37-
3. Expand **Database Snapshots**, and select the snapshot you want to view.
38-
39-
## <a name="TsqlProcedure"></a> Using Transact-SQL
40-
**To view a database snapshot**
41-
42-
1. Connect to the [!INCLUDE[ssDE](../../includes/ssde-md.md)].
43-
44-
2. From the Standard bar, click **New Query**.
45-
46-
3. To list the database snapshots of the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], query the **source_database_id** column of the [sys.databases](../../relational-databases/system-catalog-views/sys-databases-transact-sql.md) catalog view for non-NULL values.
47-
48-
## <a name="RelatedTasks"></a> Related Tasks
49-
50-
- [Create a Database Snapshot &#40;Transact-SQL&#41;](../../relational-databases/databases/create-a-database-snapshot-transact-sql.md)
51-
52-
- [Revert a Database to a Database Snapshot](../../relational-databases/databases/revert-a-database-to-a-database-snapshot.md)
53-
54-
- [Drop a Database Snapshot &#40;Transact-SQL&#41;](../../relational-databases/databases/drop-a-database-snapshot-transact-sql.md)
55-
56-
## See Also
57-
[Database Snapshots &#40;SQL Server&#41;](../../relational-databases/databases/database-snapshots-sql-server.md)
58-
59-
23+
> To create, revert to, or delete a database snapshot, you must use [!INCLUDE[tsql](../../includes/tsql-md.md)].
24+
25+
## <a id="SSMSProcedure"></a> Use SQL Server Management Studio
26+
27+
**To view a database snapshot**
28+
29+
1. In Object Explorer, connect to the instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] and then expand that instance.
30+
31+
1. Expand **Databases.**
32+
33+
1. Expand **Database Snapshots**, and select the snapshot you want to view.
34+
35+
## <a id="TsqlProcedure"></a> Use Transact-SQL
36+
37+
**To view a database snapshot**
38+
39+
1. Connect to the [!INCLUDE[ssDE](../../includes/ssde-md.md)].
40+
1. From the **Standard** bar, select **New Query**.
41+
1. To list the database snapshots of the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], query the `source_database_id` column of the [sys.databases](../../relational-databases/system-catalog-views/sys-databases-transact-sql.md) catalog view for non-NULL values.
42+
1. You can also use this query to get details about the database snapshot and its files
43+
44+
```sql
45+
SELECT
46+
db_name(db.source_database_id) source_database,
47+
db.name AS snapshot_db_name,
48+
db.database_id,
49+
db.source_database_id,
50+
db.create_date,
51+
db.compatibility_level,
52+
db.is_read_only,
53+
mf.physical_name
54+
FROM sys.databases db
55+
INNER JOIN sys.master_files mf
56+
ON db.database_id = mf.database_id
57+
WHERE db.source_database_id is not null
58+
AND mf.is_sparse =1
59+
ORDER BY db.name;
60+
```
61+
62+
## <a id="RelatedTasks"></a> Related Tasks
63+
64+
- [Create a Database Snapshot (Transact-SQL)](../../relational-databases/databases/create-a-database-snapshot-transact-sql.md)
65+
66+
- [Revert a Database to a Database Snapshot](../../relational-databases/databases/revert-a-database-to-a-database-snapshot.md)
67+
68+
- [Drop a Database Snapshot (Transact-SQL)](../../relational-databases/databases/drop-a-database-snapshot-transact-sql.md)
69+
70+
## Next steps
71+
72+
- [Database Snapshots (SQL Server)](../../relational-databases/databases/database-snapshots-sql-server.md)

docs/relational-databases/indexes/heaps-tables-without-clustered-indexes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||
1818
# Heaps (Tables without Clustered Indexes)
1919
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2020

21-
A heap is a table without a clustered index. One or more nonclustered indexes can be created on tables stored as a heap. Data is stored in the heap without specifying an order. Usually data is initially stored in the order in which is the rows are inserted into the table, but the [!INCLUDE[ssDE](../../includes/ssde-md.md)] can move data around in the heap to store the rows efficiently; so the data order cannot be predicted. To guarantee the order of rows returned from a heap, you must use the `ORDER BY` clause. To specify a permanent logical order for storing the rows, create a clustered index on the table, so that the table is not a heap.
21+
A heap is a table without a clustered index. One or more nonclustered indexes can be created on tables stored as a heap. Data is stored in the heap without specifying an order. Usually data is initially stored in the order in which the rows are inserted into the table, but the [!INCLUDE[ssDE](../../includes/ssde-md.md)] can move data around in the heap to store the rows efficiently; so the data order cannot be predicted. To guarantee the order of rows returned from a heap, you must use the `ORDER BY` clause. To specify a permanent logical order for storing the rows, create a clustered index on the table, so that the table is not a heap.
2222

2323
> [!NOTE]
2424
> There are sometimes good reasons to leave a table as a heap instead of creating a clustered index, but using heaps effectively is an advanced skill. Most tables should have a carefully chosen clustered index unless a good reason exists for leaving the table as a heap.

0 commit comments

Comments
 (0)