Skip to content

Commit b8a2ca0

Browse files
authored
Merge pull request #20598 from MicrosoftDocs/master
11/02 AM Publish
2 parents 4a1070d + e867617 commit b8a2ca0

14 files changed

Lines changed: 147 additions & 65 deletions

docs/connect/jdbc/using-table-valued-parameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Column values in table-valued parameters can be accessed using standard Transact
3131
| -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
3232
| [Table-Valued Parameters (Database Engine)](/previous-versions/sql/sql-server-2008/bb510489(v=sql.100)) in SQL Server Books Online | Describes how to create and use table-valued parameters |
3333
| [User-Defined Table Types](/previous-versions/sql/sql-server-2008/bb522526(v=sql.100)) in SQL Server Books Online | Describes user-defined table types that are used to declare table-valued parameters |
34-
| The [Microsoft SQL Server Database Engine](https://go.microsoft.com/fwlink/?LinkId=120507) section of CodePlex | Contains samples that demonstrate how to use SQL Server features and functionality |
34+
3535

3636
## Passing multiple rows in previous versions of SQL Server
3737

@@ -309,4 +309,4 @@ The following methods have been added to this class to support passing of table-
309309

310310
## See also
311311

312-
[Overview of the JDBC driver](overview-of-the-jdbc-driver.md)
312+
[Overview of the JDBC driver](overview-of-the-jdbc-driver.md)

docs/relational-databases/clr-integration-database-objects-user-defined-functions/clr-table-valued-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ go
173173
```
174174

175175
## Sample: Returning the Results of a SQL Server Query
176-
The following sample shows a table-valued function that queries a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database. This sample uses the AdventureWorks Light database from [!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)]. See [https://www.codeplex.com/sqlserversamples](https://go.microsoft.com/fwlink/?LinkId=87843) for more information on downloading AdventureWorks.
176+
The following sample shows a table-valued function that queries a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database. This sample uses the AdventureWorks Lightweight database from [!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)], see the [AdventureWorks sample databases](/sql/samples/adventureworks-install-configure#download-backup-files)
177177

178178
Name your source code file FindInvalidEmails.cs or FindInvalidEmails.vb.
179179

docs/relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types-coding.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,6 @@ public void Rotate(double anglex, double angley, double anglez)
615615

616616
The purpose of the padding is to ensure that the culture is completely separated from the currency value, so that when one UDT is compared against another in [!INCLUDE[tsql](../../includes/tsql-md.md)] code, culture bytes are compared against culture bytes, and currency byte values are compared against currency byte values.
617617

618-
For the complete code listing for the **Currency** UDT, follow the directions for installing the CLR samples in [SQL Server Database Engine Samples](https://msftengprodsamples.codeplex.com/).
619-
620618
### Currency Attributes
621619
The **Currency** UDT is defined with the following attributes.
622620

@@ -739,9 +737,5 @@ public void Read(System.IO.BinaryReader r)
739737
}
740738
```
741739

742-
For the complete code listing for the **Currency** UDT, see [SQL Server Database Engine Samples](https://msftengprodsamples.codeplex.com/).
743-
744740
## See Also
745-
[Creating a User-Defined Type](../../relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types.md)
746-
747-
741+
[Creating a User-Defined Type](../../relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types.md)

docs/relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ Reconfigure
3737
## Example
3838
The following code listing defines the Point UDT, which is described in detail in [Coding User-Defined Types](../../relational-databases/clr-integration-database-objects-user-defined-types/creating-user-defined-types-coding.md).
3939

40-
The complete code listings for the other examples discussed in this section can be obtained by installing the CLR samples. For instructions on installing these samples, see [SQL Server Database Engine Samples](https://msftengprodsamples.codeplex.com/).
41-
4240
C#
4341

4442
```

docs/relational-databases/clr-integration/assemblies/creating-an-assembly.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ FROM 'C:\MyDBApp\SQLCLRTest.dll';
4545
- The assembly that is called or referenced was created in the same database.
4646

4747
## Specifying Security When Creating Assemblies
48-
When creating an assembly into a [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] database, you can specify one of three different levels of security in which your code can run: **SAFE**, **EXTERNAL_ACCESS**, or **UNSAFE**. When the **CREATE ASSEMBLY** statement is run, certain checks are performed on the code assembly which may cause the assembly to fail to register on the server. For more information, see the Impersonation sample on [CodePlex](https://msftengprodsamples.codeplex.com/).
48+
When creating an assembly into a [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] database, you can specify one of three different levels of security in which your code can run: **SAFE**, **EXTERNAL_ACCESS**, or **UNSAFE**. When the **CREATE ASSEMBLY** statement is run, certain checks are performed on the code assembly which may cause the assembly to fail to register on the server.
4949

5050
**SAFE** is the default permission set and works for the majority of scenarios. To specify a given security level, you modify the syntax of the CREATE ASSEMBLY statement as follows:
5151

docs/relational-databases/databases/move-user-databases.md

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
description: "Move User Databases"
3-
title: "Move User Databases | Microsoft Docs"
3+
title: "Move User Databases"
44
ms.custom: ""
5-
ms.date: "03/14/2017"
5+
ms.date: "11/02/2021"
66
ms.prod: sql
77
ms.prod_service: "database-engine"
88
ms.reviewer: ""
@@ -22,49 +22,60 @@ helpviewer_keywords:
2222
- "relocating database files"
2323
- "planned database relocations [SQL Server]"
2424
- "databases [SQL Server], moving"
25-
ms.assetid: ad9a4e92-13fb-457d-996a-66ffc2d55b79
2625
author: WilliamDAssafMSFT
2726
ms.author: wiassaf
2827
---
2928
# Move User Databases
3029
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
3130
In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you can move the data, log, and full-text catalog files of a user database to a new location by specifying the new file location in the FILENAME clause of the [ALTER DATABASE](../../t-sql/statements/alter-database-transact-sql.md) statement. This method applies to moving database files within the same instance [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. To move a database to another instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] or to another server, use [backup and restore](../../relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases.md) or [detach and attach operations](../../relational-databases/databases/move-a-database-using-detach-and-attach-transact-sql.md).
31+
32+
> [!NOTE]
33+
> This article covers moving user database files. For moving system database files, see [Move System Databases](../../relational-databases/databases/move-system-databases.md).
3234
3335
## Considerations
3436
When you move a database onto another server instance, to provide a consistent experience to users and applications, you might have to re-create some or all the metadata for the database. For more information, see [Manage Metadata When Making a Database Available on Another Server Instance (SQL Server)](../../relational-databases/databases/manage-metadata-when-making-a-database-available-on-another-server.md).
3537

36-
Some features of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] change the way that the [!INCLUDE[ssDE](../../includes/ssde-md.md)] stores information in the database files. These features are restricted to specific editions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. A database that contains these features cannot be moved to an edition of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that does not support them. Use the sys.dm_db_persisted_sku_features dynamic management view to list all edition-specific features that are enabled in the current database.
38+
Some features of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] change the way that the [!INCLUDE[ssDE](../../includes/ssde-md.md)] stores information in the database files. These features are restricted to specific editions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. A database that contains these features cannot be moved to an edition of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that does not support them. Use the `sys.dm_db_persisted_sku_features` dynamic management view to list all edition-specific features that are enabled in the current database.
3739

38-
The procedures in this topic require the logical name of the database files. To obtain the name, query the name column in the [sys.master_files](../../relational-databases/system-catalog-views/sys-master-files-transact-sql.md) catalog view.
40+
The procedures in this article require the logical name of the database files. To obtain the name, query the name column in the [sys.master_files](../../relational-databases/system-catalog-views/sys-master-files-transact-sql.md) catalog view.
3941

4042
Starting with [!INCLUDE[ssKilimanjaro](../../includes/sskilimanjaro-md.md)], full-text catalogs are integrated into the database rather than being stored in the file system. The full-text catalogs now move automatically when you move a database.
43+
44+
> [!NOTE]
45+
> Make sure the service account for the [SQL Server Database Services service](../../database-engine/configure-windows/configure-windows-service-accounts-and-permissions.md) has permissions to the new file location in the file system. For more information, see [Configure File System Permissions for Database Engine Access](../../database-engine/configure-windows/configure-file-system-permissions-for-database-engine-access.md).
4146
4247
## Planned Relocation Procedure
4348
To move a data or log file as part of a planned relocation, follow these steps:
4449

4550
1. For each file to be moved, run the following statement.
4651

47-
```
52+
```sql
4853
ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name, FILENAME = 'new_path\os_file_name' );
4954
```
5055

51-
2. Run the following statement.
56+
2. Run the following statement to bring the database offline.
5257

53-
```
58+
```sql
5459
ALTER DATABASE database_name SET OFFLINE;
5560
```
61+
62+
This action requires exclusive access to the database. If another connection is open to the database, the ALTER DATABASE statement will be blocked until all connections are closed. To override this behavior, use the [`WITH <termination>` clause](../../t-sql/statements/alter-database-transact-sql-set-options.md#with-termination-). For example, to automatically rollback and disconnect all other connections to the database, use:
63+
64+
```sql
65+
ALTER DATABASE database_name SET OFFLINE WITH ROLLBACK IMMEDIATE;
66+
```
5667

5768
3. Move the file or files to the new location.
5869

5970
4. Run the following statement.
6071

61-
```
72+
```sql
6273
ALTER DATABASE database_name SET ONLINE;
6374
```
6475

6576
5. Verify the file change by running the following query.
6677

67-
```
78+
```sql
6879
SELECT name, physical_name AS CurrentLocation, state_desc
6980
FROM sys.master_files
7081
WHERE database_id = DB_ID(N'<database_name>');
@@ -75,7 +86,7 @@ ms.author: wiassaf
7586

7687
1. For each file to be moved, run the following statement.
7788

78-
```
89+
```sql
7990
ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name , FILENAME = 'new_path\os_file_name' );
8091
```
8192

@@ -87,7 +98,7 @@ ms.author: wiassaf
8798

8899
5. Verify the file change by running the following query.
89100

90-
```
101+
```sql
91102
SELECT name, physical_name AS CurrentLocation, state_desc
92103
FROM sys.master_files
93104
WHERE database_id = DB_ID(N'<database_name>');
@@ -105,21 +116,21 @@ ms.author: wiassaf
105116

106117
- For the default (MSSQLSERVER) instance, run the following command.
107118

108-
```
119+
```console
109120
NET START MSSQLSERVER /f /T3608
110121
```
111122

112123
- For a named instance, run the following command.
113124

114-
```
125+
```console
115126
NET START MSSQL$instancename /f /T3608
116127
```
117128

118129
For more information, see [Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service](../../database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services.md).
119130

120131
3. For each file to be moved, use **sqlcmd** commands or [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] to run the following statement.
121132

122-
```
133+
```sql
123134
ALTER DATABASE database_name MODIFY FILE( NAME = logical_name , FILENAME = 'new_path\os_file_name' );
124135
```
125136

@@ -135,7 +146,7 @@ ms.author: wiassaf
135146

136147
8. Verify the file change by running the following query.
137148

138-
```
149+
```sql
139150
SELECT name, physical_name AS CurrentLocation, state_desc
140151
FROM sys.master_files
141152
WHERE database_id = DB_ID(N'<database_name>');
@@ -144,7 +155,7 @@ ms.author: wiassaf
144155
## Examples
145156
The following example moves the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] log file to a new location as part of a planned relocation.
146157

147-
```
158+
```sql
148159
USE master;
149160
GO
150161
-- Return the logical file name.
@@ -172,12 +183,13 @@ WHERE database_id = DB_ID(N'AdventureWorks2012')
172183
```
173184

174185
## See Also
175-
[ALTER DATABASE &#40;Transact-SQL&#41;](../../t-sql/statements/alter-database-transact-sql.md)
176-
[CREATE DATABASE &#40;SQL Server Transact-SQL&#41;](../../t-sql/statements/create-database-transact-sql.md)
177-
[Database Detach and Attach &#40;SQL Server&#41;](../../relational-databases/databases/database-detach-and-attach-sql-server.md)
178-
[Move System Databases](../../relational-databases/databases/move-system-databases.md)
179-
[Move Database Files](../../relational-databases/databases/move-database-files.md)
180-
[BACKUP &#40;Transact-SQL&#41;](../../t-sql/statements/backup-transact-sql.md)
181-
[RESTORE &#40;Transact-SQL&#41;](../../t-sql/statements/restore-statements-transact-sql.md)
182-
[Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service](../../database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services.md)
186+
187+
- [ALTER DATABASE &#40;Transact-SQL&#41;](../../t-sql/statements/alter-database-transact-sql.md)
188+
- [CREATE DATABASE &#40;SQL Server Transact-SQL&#41;](../../t-sql/statements/create-database-transact-sql.md)
189+
- [Database Detach and Attach &#40;SQL Server&#41;](../../relational-databases/databases/database-detach-and-attach-sql-server.md)
190+
- [Move System Databases](../../relational-databases/databases/move-system-databases.md)
191+
- [Move Database Files](../../relational-databases/databases/move-database-files.md)
192+
- [BACKUP &#40;Transact-SQL&#41;](../../t-sql/statements/backup-transact-sql.md)
193+
- [RESTORE &#40;Transact-SQL&#41;](../../t-sql/statements/restore-statements-transact-sql.md)
194+
- [Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service](../../database-engine/configure-windows/start-stop-pause-resume-restart-sql-server-services.md)
183195

docs/relational-databases/databases/tempdb-database.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "tempdb database"
3-
description: This topic provides details about the configuration and use of the tempdb database in SQL Server and Azure SQL Database.
3+
description: This article provides details about the configuration and use of the tempdb database in SQL Server and Azure SQL Database.
44
ms.custom: "P360"
5-
ms.date: 07/02/2021
5+
ms.date: 10/28/2021
66
ms.prod: sql
77
ms.prod_service: "database-engine"
88
ms.technology:
@@ -226,11 +226,12 @@ Metadata contention in `tempdb` has historically been a bottleneck to scalabilit
226226

227227
This feature effectively removes this bottleneck and unlocks a new level of scalability for tempdb-heavy workloads. In [!INCLUDE[sql-server-2019](../../includes/sssql19-md.md)], the system tables involved in managing temporary table metadata can be moved into latch-free, non-durable, memory-optimized tables.
228228

229+
Currently the memory-optimized tempdb metadata feature is not available in Azure SQL Database or Azure SQL Managed Instance.
230+
229231
Watch this seven-minute video for an overview of how and when to use memory-optimized tempdb metadata:
230232

231233
> [!VIDEO https://channel9.msdn.com/Shows/Data-Exposed/How-and-When-To-Memory-Optimized-TempDB-Metadata/player?WT.mc_id=dataexposed-c9-niner]
232234
233-
234235
### Configuring and using memory-optimized tempdb metadata
235236

236237
To opt in to this new feature, use the following script:
@@ -342,10 +343,11 @@ SELECT R2.session_id,
342343
FROM sys.dm_db_session_space_usage AS R1
343344
INNER JOIN sys.dm_db_task_space_usage AS R2 ON R1.session_id = R2.session_id
344345
GROUP BY R2.session_id, R1.internal_objects_alloc_page_count,
345-
R1.internal_objects_dealloc_page_count;;
346+
R1.internal_objects_dealloc_page_count;
346347
```
347348

348-
## Related content
349+
## Next steps
350+
349351
- [SORT_IN_TEMPDB option for indexes](../../relational-databases/indexes/sort-in-TempDB-option-for-indexes.md)
350352
- [System databases](../../relational-databases/databases/system-databases.md)
351353
- [sys.databases](../../relational-databases/system-catalog-views/sys-databases-transact-sql.md)

docs/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ms.custom: seo-dt-2019
8787
To use impersonation, the configuration must meet the requirement for delegation.
8888

8989
**Remote User**
90-
Use the remote user to map users not defined in **Local login**. The **Remote User** must be a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Authentication login on the remote server.
90+
Use the remote user to map user defined in **Local login**. The **Remote User** must be a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Authentication login on the remote server.
9191

9292
**Remote Password**
9393
Specify the password of the Remote User.

docs/relational-databases/logs/troubleshoot-a-full-transaction-log-sql-server-error-9002.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.prod: sql
66
ms.prod_service: "database-engine"
77
ms.reviewer: ""
88
ms.technology: supportability
9-
ms.topic: conceptual
9+
ms.topic: troubleshooting
1010
helpviewer_keywords:
1111
- "logs [SQL Server], full"
1212
- "troubleshooting [SQL Server], full transaction log"

0 commit comments

Comments
 (0)