Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 222b9ed

Browse files
Merge branch 'master' of https://github.com/MicrosoftDocs/sql-docs-pr into us1612682b
2 parents b1f230d + 3078a71 commit 222b9ed

529 files changed

Lines changed: 592 additions & 528 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- name: Docs
2+
tocHref: /sql/
3+
topicHref: /sql/index
4+
items:
5+
- name: Azure Data Studio
6+
tocHref: /sql/azure-data-studio/
7+
topicHref: /sql/azure-data-studio/

docs/azure-data-studio/toc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
href: usage-data-collection.md
119119
- name: References
120120
items:
121+
- name: SQL tools
122+
href: ../tools/overview-sql-tools.md
123+
- name: SQL tools
124+
href: ../tools/overview-sql-tools.md
121125
- name: Azure Developer tools
122126
href: https://docs.microsoft.com/azure/?product=developer-tools
123127
- name: Resources
@@ -129,4 +133,4 @@
129133
- name: Report issues & make suggestions >
130134
href: https://github.com/microsoft/azuredatastudio/issues
131135
- name: SQL Server documentation >
132-
href: ../sql-server/index.yml
136+
href: ../sql-server/index.yml

docs/breadcrumb/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@
2828
tocHref: /sql/reporting-services/
2929
topicHref: /sql/reporting-services/create-deploy-and-manage-mobile-and-paginated-reports
3030

31+
- name: Azure Data Studio
32+
tocHref: /sql/azure-data-studio/
33+
topicHref: /sql/azure-data-studio/
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: "AppContext switches in SqlClient"
3+
description: "Describes how to use AppContext switches that are available in SqlClient."
4+
ms.date: "06/15/2020"
5+
dev_langs:
6+
- "csharp"
7+
ms.prod: sql
8+
ms.prod_service: connectivity
9+
ms.technology: connectivity
10+
ms.topic: conceptual
11+
author: johnnypham
12+
ms.author: v-jopha
13+
ms.reviewer:
14+
---
15+
# AppContext switches in Sqlclient
16+
17+
[!INCLUDE [Driver_ADONET_Download](../../includes/driver_adonet_download.md)]
18+
19+
The AppContext class allows SqlClient to provide new functionality while continuing to support callers who depend on the previous behavior. Users can opt out of a change in behavior by setting specific AppContext switches.
20+
21+
## Enabling decimal truncation behavior
22+
23+
[!INCLUDE [appliesto-netfx-netcore-netst-md](../../includes/appliesto-netfx-netcore-netst-md.md)]
24+
25+
Starting with Microsoft.Data.SqlClient 2.0, decimal data will be rounded by default, as is done by SQL Server. To enable the previous behavior of truncation, you can set the AppContext switch **"Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal"** to `true` at application startup:
26+
27+
```csharp
28+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal", true);
29+
```
30+
31+
## Enabling managed networking on Windows
32+
33+
[!INCLUDE [appliesto-xxxx-netcore-netst-md](../../includes/appliesto-xxxx-netcore-netst-md.md)]
34+
35+
On Windows, SqlClient uses a native implementation of the SNI network interface by default. To enable the use of a managed SNI implementation, you can set the AppContext switch **"Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows"** to `true` at application startup:
36+
37+
```csharp
38+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows", true);
39+
```
40+
41+
This switch will toggle the driver's behavior to use a managed networking implementation in .NET Core 2.1+ and .NET Standard 2.0+ projects on Windows, eliminating all dependencies on native libraries for the Microsoft.Data.SqlClient library. It is intended for testing and debugging purposes only.
42+
43+
> [!NOTE]
44+
> There are some known differences when compared to the native implementation. For example, the managed implementation does not support non-domain Windows Authentication.
45+
46+
## Disabling Transparent Network IP Resolution
47+
48+
[!INCLUDE [appliesto-netfx-xxxx-xxxx-md](../../includes/appliesto-netfx-xxxx-xxxx-md.md)]
49+
50+
Transparent Network IP Resolution (TNIR) is a revision of the existing MultiSubnetFailover feature. TNIR affects the connection sequence of the driver in the case where the first resolved IP of the hostname does not respond and there are multiple IPs associated with the hostname. TNIR interacts with MultiSubnetFailover to provide the following three connection sequences:<br />
51+
* 0: One IP is attempted, followed by all IPs in parallel
52+
* 1: All IPs are attempted in parallel
53+
* 2: All IPs are attempted one after another
54+
55+
|TransparentNetworkIPResolution|MultiSubnetFailover|Behavior|
56+
|--------|--------|--------|
57+
|True|True|1|
58+
|True|False|0|
59+
|False|True|1|
60+
|False|False|2|
61+
62+
TransparentNetworkIPResolution is enabled by default. MultiSubnetFailover is disabled by default. To disable TNIR, you can set the AppContext switch **"Switch.Microsoft.Data.SqlClient.DisableTNIRByDefaultInConnectionString"** to `true` at application startup:
63+
64+
```csharp
65+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.DisableTNIRByDefaultInConnectionString", true);
66+
```
67+
68+
For more information about setting these properties, see the documentation for [SqlConnection.ConnectionString Property](https://docs.microsoft.com/dotnet/api/microsoft.data.sqlclient.sqlconnection.connectionstring).
69+
70+
## Enable a minimum timeout during login
71+
72+
[!INCLUDE [appliesto-netfx-xxxx-xxxx-md](../../includes/appliesto-netfx-xxxx-xxxx-md.md)]
73+
74+
To prevent a login attempt from hanging indefinitely, you can set the AppContext switch **Switch.Microsoft.Data.SqlClient.UseOneSecFloorInTimeoutCalculationDuringLogin** to `true` at application startup:
75+
76+
```csharp
77+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseOneSecFloorInTimeoutCalculationDuringLogin", false);
78+
```
79+
80+
## Disable blocking behavior of ReadAsync
81+
82+
[!INCLUDE [appliesto-netfx-xxxx-xxxx-md](../../includes/appliesto-netfx-xxxx-xxxx-md.md)]
83+
84+
By default, ReadAsync runs synchronously and blocks the calling thread on .NET Framework. To disable this blocking behavior, you can set the AppContext switch **Switch.Microsoft.Data.SqlClient.MakeReadAsyncBlocking** to `false` at application startup:
85+
86+
```csharp
87+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.MakeReadAsyncBlocking", false);
88+
```
89+
90+
## See also
91+
92+
[AppContext Class](https://docs.microsoft.com/dotnet/api/system.appcontext?view=netcore-3.1)

docs/connect/ado-net/download-microsoft-sqlclient-data-provider.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Download Microsoft SqlClient Data Provider for SQL Server"
33
description: "Download page for ADO.NET and Microsoft SqlClient Data Provider for SQL Server."
4-
ms.date: "11/25/2019"
4+
ms.date: "06/16/2020"
55
dev_langs:
66
- "csharp"
77
- "vb"
@@ -20,6 +20,10 @@ ms.reviewer: v-kaywon
2020
The Microsoft.Data.SqlClient package is available on NuGet.org. Refer to the dependencies section from the links below to download the dependencies.
2121

2222
## Download stable versions of Microsoft SqlClient Data Provider for SQL Server
23+
* [2.0.0](https://www.nuget.org/packages/Microsoft.Data.SqlClient/2.0.0)
24+
* [1.1.3](https://www.nuget.org/packages/Microsoft.Data.SqlClient/1.1.3)
25+
* [1.1.2](https://www.nuget.org/packages/Microsoft.Data.SqlClient/1.1.2)
26+
* [1.1.1](https://www.nuget.org/packages/Microsoft.Data.SqlClient/1.1.1)
2327
* [1.1.0](https://www.nuget.org/packages/Microsoft.Data.SqlClient/1.1.0)
2428
* [1.0.19269.1](https://www.nuget.org/packages/Microsoft.Data.SqlClient/1.0.19269.1)
2529
* [1.0.19249.1](https://www.nuget.org/packages/Microsoft.Data.SqlClient/1.0.19249.1)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: "Enabling event tracing in SqlClient"
3+
description: "Describes how to enable event tracing in SqlClient by implementing an event listener and how to access the event data."
4+
ms.date: "06/15/2020"
5+
dev_langs:
6+
- "csharp"
7+
ms.prod: sql
8+
ms.prod_service: connectivity
9+
ms.technology: connectivity
10+
ms.topic: conceptual
11+
author: johnnypham
12+
ms.author: v-jopha
13+
ms.reviewer:
14+
---
15+
# Enabling event tracing in SqlClient
16+
17+
[!INCLUDE [appliesto-netfx-netcore-netst-md](../../includes/appliesto-netfx-netcore-netst-md.md)]
18+
19+
[!INCLUDE [Driver_ADONET_Download](../../includes/driver_adonet_download.md)]
20+
21+
[Event Tracing for Windows (ETW)](https://docs.microsoft.com/windows/win32/etw/event-tracing-portal) is an efficient kernel-level tracing facility that lets you log driver-defined events for debugging and testing purposes. SqlClient supports capturing ETW events at different informational levels. To begin capturing event traces, client applications should listen for events from SqlClient's EventSource implementation:
22+
23+
```
24+
Microsoft.Data.SqlClient.EventSource
25+
```
26+
27+
The current implementation supports the following Event Keywords:
28+
29+
| Keyword name | Value | Description |
30+
| ------------ | ----- | ----------- |
31+
| ExecutionTrace | 1 | Turns on capturing Start/Stop events before and after command execution. |
32+
| Trace | 2 | Turns on capturing basic application flow trace events. |
33+
| Scope | 4 | Turns on capturing enter and exit events |
34+
| NotificationTrace | 8 | Turns on capturing `SqlNotification` trace events |
35+
| NotificationScope | 16 | Turns on capturing `SqlNotification` scope enter and exit events |
36+
| PoolerTrace | 32 | Turns on capturing connection pooling flow trace events. |
37+
| PoolerScope | 64 | Turns on capturing connection pooling scope trace events. |
38+
| AdvancedTrace | 128 | Turns on capturing advanced flow trace events. |
39+
| AdvancedTraceBin | 256 | Turns on capturing advanced flow trace events with additional information. |
40+
| CorrelationTrace | 512 | Turns on capturing correlation flow trace events. |
41+
| StateDump | 1024 | Turns on capturing full state dump of `SqlConnection` |
42+
| SNITrace | 2048 | Turns on capturing flow trace events from Managed Networking implementation (only applicable in .NET Core) |
43+
| SNIScope | 4096 | Turns on capturing scope events from Managed Networking implementation (only applicable in .NET Core) |
44+
|||
45+
46+
## Example
47+
The following example enables event tracing for a data operation on the **AdventureWorks** sample database and displays the events in the console window.
48+
49+
[!code-csharp [SqlClientEventSource#1](~/../sqlclient/doc/samples/SqlClientEventSource.cs#1)]
50+
51+
## External resources
52+
For more information, see the following resources.
53+
54+
|Resource|Description|
55+
|--------------|-----------------|
56+
|[EventSource Class](https://docs.microsoft.com/dotnet/api/system.diagnostics.tracing.eventsource)|Provides the ability to create ETW events.|
57+
|[EventListener Class](https://docs.microsoft.com/dotnet/api/system.diagnostics.tracing.eventlistener)|Provides methods for enabling and disabling events from event sources.|

docs/connect/ado-net/find-additional-sqlclient-driver-information.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Finding additional SqlClient driver information"
33
description: "Page that contains useful information regarding the driver."
4-
ms.date: "09/30/2019"
4+
ms.date: "06/15/2019"
55
dev_langs:
66
- "csharp"
77
- "vb"
@@ -24,7 +24,7 @@ For more information about the Microsoft SqlClient Data Provider for SQL Server
2424

2525
|Resource|Description|
2626
|--------------|-----------------|
27-
|[.Net CoreFX GitHub Repository](https://github.com/dotnet/corefx)|This repo contains the library implementation for .NET Core.|
27+
|[.NET Runtime GitHub Repository](https://github.com/dotnet/runtime)|This repo contains the library implementation for .NET Core.|
2828
|[Microsoft SqlClient Data Provider for SQL Server GitHub Repository](https://github.com/dotnet/SqlClient)|This repo contains the source code for the SqlClient driver.|
2929
|[.NET API Browser](https://docs.microsoft.com/dotnet/api/)|This site contains .NET API information for the driver.|
3030

docs/connect/ado-net/introduction-microsoft-data-sqlclient-namespace.md

Lines changed: 108 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Introduction to Microsoft.Data.SqlClient namespace"
33
description: "Introduction page for the Microsoft.Data.SqlClient namespace."
4-
ms.date: "09/30/2019"
4+
ms.date: "06/15/2019"
55
ms.assetid: c18b1fb1-2af1-4de7-80a4-95e56fd976cb
66
ms.prod: sql
77
ms.prod_service: connectivity
@@ -13,23 +13,124 @@ ms.reviewer: v-kaywon
1313
---
1414
# Introduction to Microsoft.Data.SqlClient namespace
1515

16-
[!INCLUDE[Driver_ADONET_Download](../../includes/driver_adonet_download.md)]
16+
[!INCLUDE [Driver_ADONET_Download](../../includes/driver_adonet_download.md)]
17+
18+
## Release notes for Microsoft.Data.SqlClient 2.0
19+
20+
Release notes are also available in the GitHub Repository: [2.0 Release Notes](https://github.com/dotnet/SqlClient/tree/master/release-notes/2.0).
21+
22+
### Breaking changes
23+
24+
- The access modifier for the enclave provider interface `SqlColumnEncryptionEnclaveProvider` has been changed from `public` to `internal`.
25+
26+
- Constants in the `SqlClientMetaDataCollectionNames` class have been updated to reflect changes in SQL Server.
27+
28+
- The driver will now perform Server Certificate validation when the target SQL Server enforces TLS encryption, which is the default for Azure connections.
29+
30+
- `SqlDataReader.GetSchemaTable()` now returns an empty `DataTable` instead `null`.
31+
32+
- The driver now performs decimal scale rounding to match SQL Server behavior. For backwards compatibility, the previous behavior of truncation can be enabled using an AppContext switch.
33+
34+
- For .NET Framework applications consuming **Microsoft.Data.SqlClient**, the SNI.dll files previously downloaded to the `bin\x64` and `bin\x86` folders are now named `Microsoft.Data.SqlClient.SNI.x64.dll` and` Microsoft.Data.SqlClient.SNI.x86.dll` and will be downloaded to the `bin` directory.
35+
36+
### New features
37+
38+
#### DNS failure resiliency
39+
40+
The driver will now cache IP addresses from every successful connection to a SQL Server endpoint that supports the feature. If a DNS resolution failure occurs during a connection attempt, the driver will try establishing a connection using a cached IP address for that server, if any exists.
41+
42+
#### EventSource tracing
43+
44+
This release introduces support for capturing event trace logs for debugging applications. To capture these events, client applications must listen for events from SqlClient's EventSource implementation:
45+
46+
```
47+
Microsoft.Data.SqlClient.EventSource
48+
```
49+
50+
For more information, see how to [Enable event tracing in SqlClient](enable-eventsource-tracing.md).
51+
52+
#### Enabling managed networking on Windows
53+
54+
A new AppContext switch **"Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows"** enables the use of a managed SNI implementation on Windows for testing and debugging purposes. This switch will toggle the driver's behavior to use a managed SNI in .NET Core 2.1+ and .NET Standard 2.0+ projects on Windows, eliminating all dependencies on native libraries for the Microsoft.Data.SqlClient library.
55+
56+
```csharp
57+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows", true);
58+
```
59+
60+
See [AppContext Switches in SqlClient](appcontext-switches.md) for a full list of available switches in the driver.
61+
62+
#### Enabling decimal truncation behavior
63+
64+
The decimal data scale will be rounded by the driver by default as is done by SQL Server. For backwards compatibility, you can set the AppContext switch **"Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal"** to **true**.
65+
66+
```csharp
67+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal", true);
68+
```
69+
70+
#### New connection string property synonyms
71+
72+
New synonyms have been added for the following existing connection string properties to avoid spacing confusion around properties with more than one word. Old property names will continue to be supported for backwards compatibility.
73+
74+
|Existing connection string property|New Synonym|
75+
|-----------------------------------|-----------|
76+
| ApplicationIntent | Application Intent |
77+
| ConnectRetryCount | Connect Retry Count |
78+
| ConnectRetryInterval | Connect Retry Interval |
79+
| PoolBlockingPeriod | Pool Blocking Period |
80+
| MultipleActiveResultSets | Multiple Active Result Sets |
81+
| MultiSubnetFailover | Multiple Subnet Failover |
82+
| TransparentNetworkIPResolution | Transparent Network IP Resolution |
83+
| TrustServerCertificate | Trust Server Certificate |
84+
85+
#### SqlBulkCopy RowsCopied property
86+
87+
The RowsCopied property provides read-only access to the number of rows that have been processed in the ongoing bulk copy operation. This value may not necessarily be equal to the final number of rows added to the destination table.
88+
89+
#### Connection open overrides
90+
91+
The default behavior of SqlConnection.Open() can be overridden to disable the ten-second delay and automatic connection retries triggered by transient errors.
92+
93+
```csharp
94+
using SqlConnection sqlConnection = new SqlConnection("Data Source=(local);Integrated Security=true;Initial Catalog=AdventureWorks;");
95+
sqlConnection.Open(SqlConnectionOverrides.OpenWithoutRetry);
96+
```
97+
98+
> [!NOTE]
99+
> Note that this override can only be applied to SqlConnection.Open() and not SqlConnection.OpenAsync().
100+
101+
#### Username support for Active Directory Interactive mode
102+
103+
A username can be specified in the connection string when using Azure Active Directory Interactive authentication mode for both .NET Framework and .NET Core
104+
105+
Set a username using the **User ID** or **UID** connection string property:
106+
107+
```
108+
"Server=<server name>; Database=<db name>; Authentication=Active Directory Interactive; User Id=<username>;"
109+
```
110+
111+
#### Order hints for SqlBulkCopy
112+
113+
Order hints can be provided to improve performance for bulk copy operations on tables with clustered indexes. For more information, see the [bulk copy operations](sql/bulk-copy-order-hints.md) section.
114+
115+
#### SNI dependency changes
116+
117+
Microsoft.Data.SqlClient (.NET Core and .NET Standard) on Windows is now dependent on **Microsoft.Data.SqlClient.SNI.runtime**, replacing the previous dependency on **runtime.native.System.Data.SqlClient.SNI**. The new dependency adds support for the ARM platform along with the already supported platforms ARM64, x64, and x86 on Windows.
17118

18119
## Release notes for Microsoft.Data.SqlClient 1.1.0
19120

20121
Release notes are also available in the GitHub Repository: [1.1 Release Notes](https://github.com/dotnet/SqlClient/tree/master/release-notes/1.1).
21122

22-
### New Features
123+
### New features
23124

24125
#### Always Encrypted with secure enclaves
25126

26-
Always Encrypted is available starting in Microsoft SQL Server 2016. Secure enclaves are available starting in Microsoft SQL Server 2019. In order to use the enclave feature, connection strings should include the required attestation protocol and attestation URL. Examples:
127+
Always Encrypted is available starting in Microsoft SQL Server 2016. Secure enclaves are available starting in Microsoft SQL Server 2019. To use the enclave feature, connection strings should include the required attestation protocol and attestation URL. For example:
27128

28129
```
29130
Attestation Protocol=HGS;Enclave Attestation Url=<attestation_url_for_HGS>
30131
```
31132

32-
For more details, see:
133+
For more information, see:
33134

34135
- [SqlClient support for Always Encrypted](sql/sqlclient-support-always-encrypted.md)
35136
- [Tutorial: Develop a .NET application using Always Encrypted with secure enclaves](sql/tutorial-always-encrypted-enclaves-develop-net-apps.md)
@@ -57,7 +158,7 @@ Release notes are also available on the GitHub Repository: [1.0 Release Notes](h
57158

58159
### Data Classification
59160

60-
Data Classification brings a new set of APIs exposing read-only Data Sensitivity and Classification information about objects retrieved via SqlDataReader when the underlying source supports the feature and contains metadata about [data sensitivity and classification](../../relational-databases/security/sql-data-discovery-and-classification.md).
161+
Data Classification brings a new set of APIs exposing read-only Data Sensitivity and Classification information about objects retrieved via SqlDataReader when the underlying source supports the feature and contains metadata about [data sensitivity and classification](../../relational-databases/security/sql-data-discovery-and-classification.md). See the sample application at [Data Discovery and Classification in SqlClient](https://github.com/dotnet/SqlClient/tree/master/release-notes/1.1).
61162

62163
```csharp
63164
public class SqlDataReader
@@ -97,7 +198,7 @@ namespace Microsoft.Data.SqlClient.DataClassification
97198

98199
### UTF-8 support
99200

100-
UTF-8 support does not require any application code changes. These SqlClient changes simply optimize the communication between the client and server when the server supports UTF-8 and the underlying column collation is UTF-8. See the UTF-8 section under [What's new in SQL Server 2019 preview](../../sql-server/what-s-new-in-sql-server-ver15.md).
201+
UTF-8 support does not require any application code changes. These SqlClient changes optimize client-server communication when the server supports UTF-8 and the underlying column collation is UTF-8. See the UTF-8 section under [What's new in SQL Server 2019 preview](../../sql-server/what-s-new-in-sql-server-ver15.md).
101202

102203
### Always encrypted with enclaves
103204

0 commit comments

Comments
 (0)