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: azure-sql/database/database-copy.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ CREATE DATABASE Database2 AS COPY OF server1.Database1 (SERVICE_OBJECTIVE = ELAS
144
144
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.
145
145
146
146
> [!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.
This topic explains how to view a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database snapshot using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
This article explains how to view a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database snapshot using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
21
+
19
22
> [!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
-
## <aname="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
-
## <aname="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
-
## <aname="RelatedTasks"></a> Related Tasks
49
-
50
-
-[Create a Database Snapshot (Transact-SQL)](../../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 (Transact-SQL)](../../relational-databases/databases/drop-a-database-snapshot-transact-sql.md)
> To create, revert to, or delete a database snapshot, you must use [!INCLUDE[tsql](../../includes/tsql-md.md)].
24
+
25
+
## <aid="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
+
## <aid="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.nameAS 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
+
FROMsys.databases db
55
+
INNER JOINsys.master_files mf
56
+
ONdb.database_id=mf.database_id
57
+
WHEREdb.source_database_idis not null
58
+
ANDmf.is_sparse=1
59
+
ORDER BYdb.name;
60
+
```
61
+
62
+
## <aid="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)
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
20
20
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.
22
22
23
23
> [!NOTE]
24
24
> 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