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
When using SqlBulkCopy to bulk insert data into a column with enabled SQL "SENSITIVITY CLASSIFICATION" the WriteToServer Method throws a System.InvalidOperationException.
Exception message: System.InvalidOperationException: Internal connection fatal error.
Stack trace: at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at Microsoft.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCopyHandler)
at Microsoft.Data.SqlClient.SqlBulkCopy.CreateAndExecuteInitialQueryAsync(BulkCopySimpleResultSet& result)
at Microsoft.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
--- End of stack trace from previous location where exception was thrown ---
at SqlBulkCopy.Sample.Program.Main(String[] args) in C:\Users\raphael.CODEWORX\source\repos\SqlBulkCopy.Sample\SqlBulkCopy.Sample\Program.cs:line 35
at SqlBulkCopy.Sample.Program.<Main>(String[] args)
To reproduce
Include a complete code listing (or project/solution) that we can run to reproduce the issue.
Partial code listings, or multiple fragments of code, will slow down our response or cause us to push the issue back to you to provide code to reproduce the issue.
CREATE DATABASE [BulkTest]
GO
USE [BulkTest]
GO
CREATE TABLE [dbo].[Company](
[CompanyId] [uniqueidentifier] NOT NULL,
[CompanyName] [nvarchar](255) NOT NULL,
[Email] [nvarchar](50) NULL,
[CompanyType] [int] not null,
CONSTRAINT [PK_Company] PRIMARY KEY CLUSTERED
(
[CompanyId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
ADD SENSITIVITY CLASSIFICATION TO [dbo].[Company].[Email] WITH (label ='Confidential', label_id ='c185460f-4e20-4b89-9876-ae95f07ba087', information_type ='Contact Info', information_type_id ='5c503e21-22c6-81fa-620b-f369b8ec38d1');
Microsoft.Data.SqlClient version: 1.1.2 also tested with 2.0.0-preview3.20122.2
.NET target: netcoreapp3.1
SQL Server version: SQL Azure, Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)
Operating system: Windows 10 Version 10.0.18363 Build 18363
The text was updated successfully, but these errors were encountered:
Thank you for reporting the issue with comprehensive information to reproduce.
The error happens with WriteToServer and WriteToServerAsync at native and managed parts.
Describe the bug
When using SqlBulkCopy to bulk insert data into a column with enabled SQL "SENSITIVITY CLASSIFICATION" the WriteToServer Method throws a System.InvalidOperationException.
To reproduce
Include a complete code listing (or project/solution) that we can run to reproduce the issue.
Partial code listings, or multiple fragments of code, will slow down our response or cause us to push the issue back to you to provide code to reproduce the issue.
Expected behavior
Data to be inserted without an Exception.
Further technical details
Microsoft.Data.SqlClient version: 1.1.2 also tested with 2.0.0-preview3.20122.2
.NET target: netcoreapp3.1
SQL Server version: SQL Azure, Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)
Operating system: Windows 10 Version 10.0.18363 Build 18363
The text was updated successfully, but these errors were encountered: