diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs index 358c8a517d8..c7ddb6256b8 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs @@ -80,6 +80,8 @@ protected override Expression VisitCollate(CollateExpression collateExpression) /// protected override Expression VisitDelete(DeleteExpression deleteExpression) { + Sql.Append("SET NOCOUNT OFF").AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator); + var selectExpression = deleteExpression.SelectExpression; if (selectExpression is @@ -281,6 +283,8 @@ protected override Expression VisitTableValuedFunction(TableValuedFunctionExpres /// protected override Expression VisitUpdate(UpdateExpression updateExpression) { + Sql.Append("SET NOCOUNT OFF").AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator); + var selectExpression = updateExpression.SelectExpression; if (selectExpression is diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCFiltersInheritanceBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCFiltersInheritanceBulkUpdatesSqlServerTest.cs index 78fae84f2eb..0968918130d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCFiltersInheritanceBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCFiltersInheritanceBulkUpdatesSqlServerTest.cs @@ -27,6 +27,7 @@ public override async Task Delete_where_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [k] FROM [Kiwi] AS [k] WHERE [k].[CountryId] = 1 AND [k].[Name] = N'Great spotted kiwi' @@ -39,6 +40,7 @@ public override async Task Delete_where_using_hierarchy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -60,6 +62,7 @@ public override async Task Delete_where_using_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -136,6 +139,7 @@ public override async Task Update_base_property_on_derived_type(bool async) """ @p='SomeOtherKiwi' (Size = 4000) +SET NOCOUNT OFF; UPDATE [k] SET [k].[Name] = @p FROM [Kiwi] AS [k] @@ -151,6 +155,7 @@ public override async Task Update_derived_property_on_derived_type(bool async) """ @p='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [k] SET [k].[FoundOn] = @p FROM [Kiwi] AS [k] @@ -166,6 +171,7 @@ public override async Task Update_where_using_hierarchy(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -191,6 +197,7 @@ public override async Task Update_base_and_derived_types(bool async) @p='Kiwi' (Size = 4000) @p1='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [k] SET [k].[Name] = @p, [k].[FoundOn] = @p1 @@ -207,6 +214,7 @@ public override async Task Update_where_using_hierarchy_derived(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCInheritanceBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCInheritanceBulkUpdatesSqlServerTest.cs index efe4ac6d2b6..f8e05db5e02 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCInheritanceBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPCInheritanceBulkUpdatesSqlServerTest.cs @@ -27,6 +27,7 @@ public override async Task Delete_where_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [k] FROM [Kiwi] AS [k] WHERE [k].[Name] = N'Great spotted kiwi' @@ -39,6 +40,7 @@ public override async Task Delete_where_using_hierarchy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -60,6 +62,7 @@ public override async Task Delete_where_using_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -136,6 +139,7 @@ public override async Task Update_base_property_on_derived_type(bool async) """ @p='SomeOtherKiwi' (Size = 4000) +SET NOCOUNT OFF; UPDATE [k] SET [k].[Name] = @p FROM [Kiwi] AS [k] @@ -150,6 +154,7 @@ public override async Task Update_derived_property_on_derived_type(bool async) """ @p='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [k] SET [k].[FoundOn] = @p FROM [Kiwi] AS [k] @@ -164,6 +169,7 @@ public override async Task Update_where_using_hierarchy(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -189,6 +195,7 @@ public override async Task Update_base_and_derived_types(bool async) @p='Kiwi' (Size = 4000) @p1='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [k] SET [k].[Name] = @p, [k].[FoundOn] = @p1 @@ -204,6 +211,7 @@ public override async Task Update_where_using_hierarchy_derived(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -225,6 +233,7 @@ public override async Task Update_with_interface_in_property_expression(bool asy """ @p='0' +SET NOCOUNT OFF; UPDATE [c] SET [c].[SugarGrams] = @p FROM [Coke] AS [c] @@ -239,6 +248,7 @@ public override async Task Update_with_interface_in_EF_Property_in_property_expr """ @p='0' +SET NOCOUNT OFF; UPDATE [c] SET [c].[SugarGrams] = @p FROM [Coke] AS [c] diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHFiltersInheritanceBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHFiltersInheritanceBulkUpdatesSqlServerTest.cs index a7066161d6f..26b3ae47f40 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHFiltersInheritanceBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHFiltersInheritanceBulkUpdatesSqlServerTest.cs @@ -21,6 +21,7 @@ public override async Task Delete_where_hierarchy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[CountryId] = 1 AND [a].[Name] = N'Great spotted kiwi' @@ -33,6 +34,7 @@ public override async Task Delete_where_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[Discriminator] = N'Kiwi' AND [a].[CountryId] = 1 AND [a].[Name] = N'Great spotted kiwi' @@ -45,6 +47,7 @@ public override async Task Delete_where_using_hierarchy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -60,6 +63,7 @@ public override async Task Delete_where_using_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -89,6 +93,7 @@ public override async Task Delete_GroupBy_Where_Select_First_3(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[CountryId] = 1 AND [a].[Id] IN ( @@ -120,6 +125,7 @@ public override async Task Delete_where_hierarchy_subquery(bool async) @p='0' @p1='3' +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[Id] IN ( @@ -140,6 +146,7 @@ public override async Task Update_base_type(bool async) """ @p='Animal' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -155,6 +162,7 @@ public override async Task Update_base_type_with_OfType(bool async) """ @p='NewBird' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -177,6 +185,7 @@ public override async Task Update_base_property_on_derived_type(bool async) """ @p='SomeOtherKiwi' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -192,6 +201,7 @@ public override async Task Update_derived_property_on_derived_type(bool async) """ @p='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [a] SET [a].[FoundOn] = @p FROM [Animals] AS [a] @@ -208,6 +218,7 @@ public override async Task Update_base_and_derived_types(bool async) @p='Kiwi' (Size = 4000) @p1='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p, [a].[FoundOn] = @p1 @@ -224,6 +235,7 @@ public override async Task Update_where_using_hierarchy(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -242,6 +254,7 @@ public override async Task Update_where_using_hierarchy_derived(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHInheritanceBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHInheritanceBulkUpdatesSqlServerTest.cs index f99b7e09cb6..5ec3d8766d1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHInheritanceBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPHInheritanceBulkUpdatesSqlServerTest.cs @@ -20,6 +20,7 @@ public override async Task Delete_where_hierarchy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[Name] = N'Great spotted kiwi' @@ -32,6 +33,7 @@ public override async Task Delete_where_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[Discriminator] = N'Kiwi' AND [a].[Name] = N'Great spotted kiwi' @@ -44,6 +46,7 @@ public override async Task Delete_where_using_hierarchy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -59,6 +62,7 @@ public override async Task Delete_where_using_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -88,6 +92,7 @@ public override async Task Delete_GroupBy_Where_Select_First_3(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[Id] IN ( @@ -118,6 +123,7 @@ public override async Task Delete_where_hierarchy_subquery(bool async) @p='0' @p1='3' +SET NOCOUNT OFF; DELETE FROM [a] FROM [Animals] AS [a] WHERE [a].[Id] IN ( @@ -138,6 +144,7 @@ public override async Task Update_base_type(bool async) """ @p='Animal' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -153,6 +160,7 @@ public override async Task Update_base_type_with_OfType(bool async) """ @p='NewBird' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -175,6 +183,7 @@ public override async Task Update_base_property_on_derived_type(bool async) """ @p='SomeOtherKiwi' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -190,6 +199,7 @@ public override async Task Update_derived_property_on_derived_type(bool async) """ @p='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [a] SET [a].[FoundOn] = @p FROM [Animals] AS [a] @@ -205,6 +215,7 @@ public override async Task Update_where_using_hierarchy(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -224,6 +235,7 @@ public override async Task Update_base_and_derived_types(bool async) @p='Kiwi' (Size = 4000) @p1='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p, [a].[FoundOn] = @p1 @@ -240,6 +252,7 @@ public override async Task Update_where_using_hierarchy_derived(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -265,6 +278,7 @@ public override async Task Update_with_interface_in_property_expression(bool asy """ @p='0' +SET NOCOUNT OFF; UPDATE [d] SET [d].[SugarGrams] = @p FROM [Drinks] AS [d] @@ -280,6 +294,7 @@ public override async Task Update_with_interface_in_EF_Property_in_property_expr """ @p='0' +SET NOCOUNT OFF; UPDATE [d] SET [d].[SugarGrams] = @p FROM [Drinks] AS [d] diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTFiltersInheritanceBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTFiltersInheritanceBulkUpdatesSqlServerTest.cs index 8fdbb069664..ee8d53c9b25 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTFiltersInheritanceBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTFiltersInheritanceBulkUpdatesSqlServerTest.cs @@ -34,6 +34,7 @@ public override async Task Delete_where_using_hierarchy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -49,6 +50,7 @@ public override async Task Delete_where_using_hierarchy_derived(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Countries] AS [c] WHERE ( @@ -102,6 +104,7 @@ public override async Task Update_base_type(bool async) """ @p='Animal' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -117,6 +120,7 @@ public override async Task Update_base_type_with_OfType(bool async) """ @p='NewBird' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -140,6 +144,7 @@ public override async Task Update_base_property_on_derived_type(bool async) """ @p='SomeOtherKiwi' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -157,6 +162,7 @@ public override async Task Update_derived_property_on_derived_type(bool async) """ @p='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [k] SET [k].[FoundOn] = @p FROM [Animals] AS [a] @@ -181,6 +187,7 @@ public override async Task Update_where_using_hierarchy(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -199,6 +206,7 @@ public override async Task Update_where_using_hierarchy_derived(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTInheritanceBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTInheritanceBulkUpdatesSqlServerTest.cs index fc30b11585f..90da363c4b2 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTInheritanceBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/Inheritance/TPTInheritanceBulkUpdatesSqlServerTest.cs @@ -86,6 +86,7 @@ public override async Task Update_base_type(bool async) """ @p='Animal' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -101,6 +102,7 @@ public override async Task Update_base_type_with_OfType(bool async) """ @p='NewBird' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -124,6 +126,7 @@ public override async Task Update_base_property_on_derived_type(bool async) """ @p='SomeOtherKiwi' (Size = 4000) +SET NOCOUNT OFF; UPDATE [a] SET [a].[Name] = @p FROM [Animals] AS [a] @@ -140,6 +143,7 @@ public override async Task Update_derived_property_on_derived_type(bool async) """ @p='0' (Size = 1) +SET NOCOUNT OFF; UPDATE [k] SET [k].[FoundOn] = @p FROM [Animals] AS [a] @@ -163,6 +167,7 @@ public override async Task Update_where_using_hierarchy(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -181,6 +186,7 @@ public override async Task Update_where_using_hierarchy_derived(bool async) """ @p='Monovia' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[Name] = @p FROM [Countries] AS [c] @@ -207,6 +213,7 @@ public override async Task Update_with_interface_in_property_expression(bool asy """ @p='0' +SET NOCOUNT OFF; UPDATE [c] SET [c].[SugarGrams] = @p FROM [Drinks] AS [d] @@ -222,6 +229,7 @@ public override async Task Update_with_interface_in_EF_Property_in_property_expr """ @p='0' +SET NOCOUNT OFF; UPDATE [c] SET [c].[SugarGrams] = @p FROM [Drinks] AS [d] diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs index 35dbbe2c54f..068adee4a38 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqlServerTest.cs @@ -20,6 +20,7 @@ public override async Task Delete_aggregate_root_when_eager_loaded_owned_collect AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Owner] AS [o] """); @@ -33,6 +34,7 @@ public override async Task Delete_with_owned_collection_and_non_natively_transla """ @p='1' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Owner] AS [o] WHERE [o].[Id] IN ( @@ -50,6 +52,7 @@ public override async Task Delete_aggregate_root_when_table_sharing_with_owned(b AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Owner] AS [o] """); @@ -70,6 +73,7 @@ public override async Task Replace_ColumnExpression_in_column_setter(bool async) """ @p='SomeValue' (Size = 4000) +SET NOCOUNT OFF; UPDATE [o0] SET [o0].[Value] = @p FROM [Owner] AS [o] @@ -85,6 +89,7 @@ public override async Task Update_non_owned_property_on_entity_with_owned(bool a """ @p='SomeValue' (Size = 4000) +SET NOCOUNT OFF; UPDATE [o] SET [o].[Title] = @p FROM [Owner] AS [o] @@ -97,6 +102,7 @@ public override async Task Update_non_owned_property_on_entity_with_owned2(bool AssertSql( """ +SET NOCOUNT OFF; UPDATE [o] SET [o].[Title] = COALESCE([o].[Title], N'') + N'_Suffix' FROM [Owner] AS [o] @@ -111,6 +117,7 @@ public override async Task Update_non_owned_property_on_entity_with_owned_in_joi """ @p='NewValue' (Size = 4000) +SET NOCOUNT OFF; UPDATE [o] SET [o].[Title] = @p FROM [Owner] AS [o] @@ -124,6 +131,7 @@ public override async Task Update_owned_and_non_owned_properties_with_table_shar AssertSql( """ +SET NOCOUNT OFF; UPDATE [o] SET [o].[Title] = COALESCE(CONVERT(varchar(11), [o].[OwnedReference_Number]), ''), [o].[OwnedReference_Number] = CAST(LEN([o].[Title]) AS int) @@ -137,6 +145,7 @@ public override async Task Update_main_table_in_entity_with_entity_splitting(boo AssertSql( """ +SET NOCOUNT OFF; UPDATE [b] SET [b].[CreationTimestamp] = '2020-01-01T00:00:00.0000000' FROM [Blogs] AS [b] @@ -149,6 +158,7 @@ public override async Task Update_non_main_table_in_entity_with_entity_splitting AssertSql( """ +SET NOCOUNT OFF; UPDATE [b0] SET [b0].[Title] = CONVERT(varchar(11), [b0].[Rating]), [b0].[Rating] = CAST(LEN([b0].[Title]) AS int) @@ -163,6 +173,7 @@ public override async Task Delete_entity_with_auto_include(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [c] FROM [Context30572_Principal] AS [c] """); @@ -174,6 +185,7 @@ public override async Task Delete_predicate_based_on_optional_navigation(bool as AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [p] FROM [Posts] AS [p] LEFT JOIN [Blogs] AS [b] ON [p].[BlogId] = [b].[Id] @@ -187,6 +199,7 @@ public override async Task Update_with_alias_uniquification_in_setter_subquery(b AssertSql( """ +SET NOCOUNT OFF; UPDATE [o] SET [o].[Total] = ( SELECT COALESCE(SUM([o0].[Amount]), 0) @@ -203,6 +216,7 @@ public override async Task Delete_with_view_mapping(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [b] FROM [Blogs] AS [b] """); @@ -216,6 +230,7 @@ public override async Task Update_with_view_mapping(bool async) """ @p='Updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [b] SET [b].[Data] = @p FROM [Blogs] AS [b] @@ -231,6 +246,7 @@ public override async Task Update_complex_type_with_view_mapping(bool async) @complex_type_p_Prop1='3' (Nullable = true) @complex_type_p_Prop2='4' (Nullable = true) +SET NOCOUNT OFF; UPDATE [b] SET [b].[ComplexThing_Prop1] = @complex_type_p_Prop1, [b].[ComplexThing_Prop2] = @complex_type_p_Prop2 @@ -247,6 +263,7 @@ public override async Task Update_complex_type_property_with_view_mapping(bool a """ @p='6' +SET NOCOUNT OFF; UPDATE [b] SET [b].[ComplexThing_Prop1] = @p FROM [Blogs] AS [b] diff --git a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs index 5c5dd2409f9..1c3335906eb 100644 --- a/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesSqlServerTest.cs @@ -1,6 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore.TestModels.Northwind; + namespace Microsoft.EntityFrameworkCore.BulkUpdates; #nullable disable @@ -22,6 +25,7 @@ public override async Task Delete_Where_TagWith(bool async) """ -- MyDelete +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE [o].[OrderID] < 10300 @@ -34,6 +38,7 @@ public override async Task Delete_Where(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE [o].[OrderID] < 10300 @@ -48,12 +53,14 @@ public override async Task Delete_Where_parameter(bool async) """ @quantity='1' (Nullable = true) (DbType = Int16) +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE [o].[Quantity] = @quantity """, // """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE 0 = 1 @@ -66,6 +73,7 @@ public override async Task Delete_Where_OrderBy(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -83,6 +91,7 @@ public override async Task Delete_Where_OrderBy_Skip(bool async) """ @p='100' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -106,6 +115,7 @@ public override async Task Delete_Where_OrderBy_Take(bool async) """ @p='100' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -128,6 +138,7 @@ public override async Task Delete_Where_OrderBy_Skip_Take(bool async) """ @p='100' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -151,6 +162,7 @@ public override async Task Delete_Where_Skip(bool async) """ @p='100' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -174,6 +186,7 @@ public override async Task Delete_Where_Take(bool async) """ @p='100' +SET NOCOUNT OFF; DELETE TOP(@p) FROM [o] FROM [Order Details] AS [o] WHERE [o].[OrderID] < 10300 @@ -188,6 +201,7 @@ public override async Task Delete_Where_Skip_Take(bool async) """ @p='100' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -209,6 +223,7 @@ public override async Task Delete_Where_predicate_with_GroupBy_aggregate(bool as AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE [o].[OrderID] < ( @@ -228,6 +243,7 @@ public override async Task Delete_Where_predicate_with_GroupBy_aggregate_2(bool AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] @@ -267,6 +283,7 @@ public override async Task Delete_Where_Skip_Take_Skip_Take_causing_subquery(boo @p2='20' @p3='5' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -293,6 +310,7 @@ public override async Task Delete_Where_Distinct(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE [o].[OrderID] < 10300 @@ -305,6 +323,7 @@ public override async Task Delete_SelectMany(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o0] FROM [Orders] AS [o] INNER JOIN [Order Details] AS [o0] ON [o].[OrderID] = [o0].[OrderID] @@ -318,6 +337,7 @@ public override async Task Delete_SelectMany_subquery(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -338,6 +358,7 @@ public override async Task Delete_Where_using_navigation(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] @@ -351,6 +372,7 @@ public override async Task Delete_Where_using_navigation_2(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] @@ -365,6 +387,7 @@ public override async Task Delete_Union(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -388,6 +411,7 @@ public override async Task Delete_Concat(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -411,6 +435,7 @@ public override async Task Delete_Intersect(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -434,6 +459,7 @@ public override async Task Delete_Except(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -478,6 +504,7 @@ public override async Task Delete_FromSql_converted_to_subquery(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -497,6 +524,7 @@ public override async Task Delete_Where_optional_navigation_predicate(bool async AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] INNER JOIN [Orders] AS [o0] ON [o].[OrderID] = [o0].[OrderID] @@ -514,6 +542,7 @@ public override async Task Delete_with_join(bool async) @p='0' @p1='100' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] INNER JOIN ( @@ -532,6 +561,7 @@ public override async Task Delete_with_LeftJoin(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE [o].[OrderID] < 10276 @@ -544,6 +574,7 @@ public override async Task Delete_with_LeftJoin_via_flattened_GroupJoin(bool asy AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE [o].[OrderID] < 10276 @@ -556,6 +587,7 @@ public override async Task Delete_with_cross_join(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] CROSS JOIN ( @@ -575,6 +607,7 @@ public override async Task Delete_with_cross_apply(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] CROSS APPLY ( @@ -594,6 +627,7 @@ public override async Task Delete_with_outer_apply(bool async) AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] OUTER APPLY ( @@ -616,6 +650,7 @@ public override async Task Delete_with_RightJoin(bool async) @p='0' @p1='100' +SET NOCOUNT OFF; DELETE FROM [o] FROM [Order Details] AS [o] WHERE EXISTS ( @@ -646,6 +681,7 @@ public override async Task Update_Where_set_constant_TagWith(bool async) -- MyUpdate +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -661,6 +697,7 @@ public override async Task Update_set_constant_TagWith_null(bool async) """ -- MyUpdate +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = NULL FROM [Customers] AS [c] @@ -675,6 +712,7 @@ public override async Task Update_Where_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -688,6 +726,7 @@ public override async Task Update_Where_set_constant_via_lambda(bool async) AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = N'Updated' FROM [Customers] AS [c] @@ -717,6 +756,7 @@ public override async Task Update_Where_parameter_set_constant(bool async) @p='Updated' (Size = 30) @customer='ALFKI' (Size = 5) (DbType = StringFixedLength) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -740,6 +780,7 @@ FROM [Customers] AS [c] """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -755,6 +796,7 @@ public override async Task Update_Where_set_parameter(bool async) """ @p='Abc' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -770,6 +812,7 @@ public override async Task Update_Where_set_parameter_from_closure_array(bool as """ @p='Abc' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -785,6 +828,7 @@ public override async Task Update_Where_set_parameter_from_inline_list(bool asyn """ @p='Abc' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -800,6 +844,7 @@ public override async Task Update_Where_set_parameter_from_multilevel_property_a """ @p='Abc' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -816,6 +861,7 @@ public override async Task Update_Where_Skip_set_constant(bool async) @p1='Updated' (Size = 30) @p='4' +SET NOCOUNT OFF; UPDATE [c0] SET [c0].[ContactName] = @p1 FROM [Customers] AS [c0] @@ -838,6 +884,7 @@ public override async Task Update_Where_Take_set_constant(bool async) @p='4' @p1='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE TOP(@p) [c] SET [c].[ContactName] = @p1 FROM [Customers] AS [c] @@ -855,6 +902,7 @@ public override async Task Update_Where_Skip_Take_set_constant(bool async) @p='2' @p1='4' +SET NOCOUNT OFF; UPDATE [c0] SET [c0].[ContactName] = @p2 FROM [Customers] AS [c0] @@ -876,6 +924,7 @@ public override async Task Update_Where_OrderBy_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c0] SET [c0].[ContactName] = @p FROM [Customers] AS [c0] @@ -896,6 +945,7 @@ public override async Task Update_Where_OrderBy_Skip_set_constant(bool async) @p1='Updated' (Size = 30) @p='4' +SET NOCOUNT OFF; UPDATE [c0] SET [c0].[ContactName] = @p1 FROM [Customers] AS [c0] @@ -918,6 +968,7 @@ public override async Task Update_Where_OrderBy_Take_set_constant(bool async) @p1='Updated' (Size = 30) @p='4' +SET NOCOUNT OFF; UPDATE [c0] SET [c0].[ContactName] = @p1 FROM [Customers] AS [c0] @@ -940,6 +991,7 @@ public override async Task Update_Where_OrderBy_Skip_Take_set_constant(bool asyn @p='2' @p1='4' +SET NOCOUNT OFF; UPDATE [c0] SET [c0].[ContactName] = @p2 FROM [Customers] AS [c0] @@ -963,6 +1015,7 @@ public override async Task Update_Where_OrderBy_Skip_Take_Skip_Take_set_constant @p='2' @p1='6' +SET NOCOUNT OFF; UPDATE [c1] SET [c1].[ContactName] = @p4 FROM [Customers] AS [c1] @@ -989,6 +1042,7 @@ public override async Task Update_Where_GroupBy_aggregate_set_constant(bool asyn """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1008,6 +1062,7 @@ public override async Task Update_Where_GroupBy_First_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1037,6 +1092,7 @@ public override async Task Update_Where_GroupBy_First_set_constant_3(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1061,6 +1117,7 @@ public override async Task Update_Where_Distinct_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c0] SET [c0].[ContactName] = @p FROM [Customers] AS [c0] @@ -1078,6 +1135,7 @@ public override async Task Update_Where_using_navigation_set_null(bool async) AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [o] SET [o].[OrderDate] = NULL FROM [Orders] AS [o] @@ -1094,6 +1152,7 @@ public override async Task Update_Where_using_navigation_2_set_constant(bool asy """ @p='1' +SET NOCOUNT OFF; UPDATE [o] SET [o].[Quantity] = CAST(@p AS smallint) FROM [Order Details] AS [o] @@ -1109,6 +1168,7 @@ public override async Task Update_Where_SelectMany_set_null(bool async) AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [o] SET [o].[OrderDate] = NULL FROM [Customers] AS [c] @@ -1123,6 +1183,7 @@ public override async Task Update_Where_set_property_plus_constant(bool async) AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = COALESCE([c].[ContactName], N'') + N'Abc' FROM [Customers] AS [c] @@ -1138,6 +1199,7 @@ public override async Task Update_Where_set_property_plus_parameter(bool async) """ @value='Abc' (Size = 4000) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = COALESCE([c].[ContactName], N'') + @value FROM [Customers] AS [c] @@ -1151,6 +1213,7 @@ public override async Task Update_Where_set_property_plus_property(bool async) AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = COALESCE([c].[ContactName], N'') + [c].[CustomerID] FROM [Customers] AS [c] @@ -1166,6 +1229,7 @@ public override async Task Update_Where_set_constant_using_ef_property(bool asyn """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1179,6 +1243,7 @@ public override async Task Update_Where_set_null(bool async) AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = NULL FROM [Customers] AS [c] @@ -1202,6 +1267,7 @@ public override async Task Update_Where_multiple_set(bool async) @value='Abc' (Size = 30) @p='Seattle' (Size = 15) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @value, [c].[City] = @p @@ -1239,6 +1305,7 @@ public override async Task Update_Union_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c1] SET [c1].[ContactName] = @p FROM [Customers] AS [c1] @@ -1262,6 +1329,7 @@ public override async Task Update_Concat_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c1] SET [c1].[ContactName] = @p FROM [Customers] AS [c1] @@ -1285,6 +1353,7 @@ public override async Task Update_Except_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c1] SET [c1].[ContactName] = @p FROM [Customers] AS [c1] @@ -1308,6 +1377,7 @@ public override async Task Update_Intersect_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c1] SET [c1].[ContactName] = @p FROM [Customers] AS [c1] @@ -1331,6 +1401,7 @@ public override async Task Update_with_join_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1351,6 +1422,7 @@ public override async Task Update_with_LeftJoin(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1371,6 +1443,7 @@ public override async Task Update_with_LeftJoin_via_flattened_GroupJoin(bool asy """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1391,6 +1464,7 @@ public override async Task Update_with_RightJoin(bool async) """ @p='2020-01-01T00:00:00.0000000Z' (Nullable = true) (DbType = DateTime) +SET NOCOUNT OFF; UPDATE [o1] SET [o1].[OrderDate] = @p FROM [Orders] AS [o1] @@ -1418,6 +1492,7 @@ public override async Task Update_with_cross_join_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1438,6 +1513,7 @@ public override async Task Update_with_cross_apply_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1458,6 +1534,7 @@ public override async Task Update_with_outer_apply_set_constant(bool async) """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1478,6 +1555,7 @@ public override async Task Update_with_cross_join_left_join_set_constant(bool as """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1503,6 +1581,7 @@ public override async Task Update_with_cross_join_cross_apply_set_constant(bool """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1528,6 +1607,7 @@ public override async Task Update_with_cross_join_outer_apply_set_constant(bool """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1558,6 +1638,7 @@ public override async Task Update_Where_SelectMany_subquery_set_null(bool async) AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [o1] SET [o1].[OrderDate] = NULL FROM [Orders] AS [o1] @@ -1580,6 +1661,7 @@ public override async Task Update_Where_Join_set_property_from_joined_single_res AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [c] SET [c].[City] = COALESCE(CONVERT(varchar(11), DATEPART(year, ( SELECT TOP(1) [o].[OrderDate] @@ -1597,6 +1679,7 @@ public override async Task Update_Where_Join_set_property_from_joined_table(bool AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [c] SET [c].[City] = [c1].[City] FROM [Customers] AS [c] @@ -1615,6 +1698,7 @@ public override async Task Update_Where_Join_set_property_from_joined_single_res AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [c] SET [c].[City] = COALESCE(CONVERT(varchar(11), DATEPART(year, ( SELECT TOP(1) [o].[OrderDate] @@ -1635,6 +1719,7 @@ public override async Task Update_with_two_inner_joins(bool async) """ @p='1' +SET NOCOUNT OFF; UPDATE [o] SET [o].[Quantity] = CAST(@p AS smallint) FROM [Order Details] AS [o] @@ -1654,6 +1739,7 @@ public override async Task Update_with_PK_pushdown_and_join_and_multiple_setters @p='1' @p2='10' (DbType = Currency) +SET NOCOUNT OFF; UPDATE [o2] SET [o2].[Quantity] = CAST(@p AS smallint), [o2].[UnitPrice] = @p2 @@ -1672,6 +1758,40 @@ OFFSET @p ROWS """); } + [ConditionalFact] + public virtual async Task ExecuteUpdate_returns_correct_rows_affected_when_nocount_on_on_open_connection() + { + var connectionString = Fixture.TestStore.ConnectionString; + await using var sqlConnection = new SqlConnection(connectionString); + await sqlConnection.OpenAsync(); + + var contextOptions = Fixture.AddOptions(new DbContextOptionsBuilder()) + .UseSqlServer(sqlConnection) + .ConfigureWarnings(w => w.Ignore(SqlServerEventId.DecimalTypeDefaultWarning)) + .Options; + + using var context = new NorthwindSqlServerContext(contextOptions); + var customerId = "FIXED"; + + await context.Database.ExecuteSqlRawAsync($"DELETE FROM [Orders] WHERE [CustomerID] = '{customerId}'"); + await context.Database.ExecuteSqlRawAsync($"DELETE FROM [Customers] WHERE [CustomerID] = '{customerId}'"); + + await context.Database.ExecuteSqlRawAsync( + $"INSERT INTO [Customers] ([CustomerID], [CompanyName], [ContactName]) VALUES ('{customerId}', 'Test Corp', 'Owner')"); + + await context.Database.ExecuteSqlRawAsync( + $"INSERT INTO [Orders] ([CustomerID], [OrderDate]) VALUES ('{customerId}', GETDATE())"); + + await context.Database.ExecuteSqlRawAsync("SET NOCOUNT ON;"); + var affected = await context.Customers + .Where(c => c.CustomerID == customerId) + .ExecuteUpdateAsync(setters => setters.SetProperty(c => c.City, "Cairo")); + Assert.Equal(1, affected); + await context.Database.ExecuteSqlRawAsync("SET NOCOUNT OFF;"); + + await context.Database.ExecuteSqlRawAsync($"DELETE FROM [Orders] WHERE [CustomerID] = '{customerId}'"); + await context.Database.ExecuteSqlRawAsync($"DELETE FROM [Customers] WHERE [CustomerID] = '{customerId}'"); + } public override async Task Update_with_select_mixed_entity_scalar_anonymous_projection(bool async) { await base.Update_with_select_mixed_entity_scalar_anonymous_projection(async); @@ -1680,6 +1800,7 @@ public override async Task Update_with_select_mixed_entity_scalar_anonymous_proj """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -1694,6 +1815,7 @@ public override async Task Update_with_select_scalar_anonymous_projection(bool a """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateSqlServerTest.cs index 34e76a9b2da..b1340286394 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonBulkUpdateSqlServerTest.cs @@ -18,6 +18,7 @@ public override async Task Delete_entity_with_associations() """ @deletableEntity_Name='Root3_With_different_values' (Size = 4000) +SET NOCOUNT OFF; DELETE FROM [r] FROM [RootEntity] AS [r] WHERE [r].[Name] = @deletableEntity_Name @@ -52,6 +53,7 @@ public override async Task Update_property_inside_associate() """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.String', @p) FROM [RootEntity] AS [r] @@ -63,6 +65,7 @@ FROM [RootEntity] AS [r] """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.String', @p) FROM [RootEntity] AS [r] @@ -78,6 +81,7 @@ public override async Task Update_property_inside_associate_with_special_chars() { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.String', N'{ Some other/JSON:like text though it [isn''t]: ממש ממש לאéèéè }') FROM [RootEntity] AS [r] @@ -88,6 +92,7 @@ WHERE JSON_VALUE([r].[RequiredAssociate], '$.String' RETURNING nvarchar(max)) = { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.String', N'{ Some other/JSON:like text though it [isn''t]: ממש ממש לאéèéè }') FROM [RootEntity] AS [r] @@ -106,6 +111,7 @@ public override async Task Update_property_inside_nested_associate() """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.RequiredNestedAssociate.String', @p) FROM [RootEntity] AS [r] @@ -117,6 +123,7 @@ FROM [RootEntity] AS [r] """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.RequiredNestedAssociate.String', @p) FROM [RootEntity] AS [r] @@ -134,6 +141,7 @@ public override async Task Update_property_on_projected_associate() """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.String', @p) FROM [RootEntity] AS [r] @@ -145,6 +153,7 @@ FROM [RootEntity] AS [r] """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.String', @p) FROM [RootEntity] AS [r] @@ -178,6 +187,7 @@ public override async Task Update_associate_to_parameter() """ @complex_type_p='{"Id":1000,"Int":80,"Ints":[1,2,3],"Name":"Updated associate name","String":"Updated nested string","NestedCollection":[],"OptionalNestedAssociate":null,"RequiredNestedAssociate":{"Id":1000,"Int":80,"Ints":[1,2,3],"Name":"Updated nested name","String":"Updated nested string"}}' (Size = 277) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = @complex_type_p FROM [RootEntity] AS [r] @@ -194,6 +204,7 @@ public override async Task Update_nested_associate_to_parameter() """ @complex_type_p='{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name","String":"Updated nested string"}' (Size = 97) +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.RequiredNestedAssociate', @complex_type_p) FROM [RootEntity] AS [r] @@ -205,6 +216,7 @@ FROM [RootEntity] AS [r] """ @complex_type_p='{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name","String":"Updated nested string"}' (Size = 97) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.RequiredNestedAssociate', JSON_QUERY(@complex_type_p)) FROM [RootEntity] AS [r] @@ -218,6 +230,7 @@ public override async Task Update_associate_to_another_associate() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate] = [r].[RequiredAssociate] FROM [RootEntity] AS [r] @@ -232,6 +245,7 @@ public override async Task Update_nested_associate_to_another_nested_associate() { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.OptionalNestedAssociate', JSON_QUERY([r].[RequiredAssociate], '$.RequiredNestedAssociate')) FROM [RootEntity] AS [r] @@ -241,6 +255,7 @@ FROM [RootEntity] AS [r] { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.OptionalNestedAssociate', JSON_QUERY([r].[RequiredAssociate], '$.RequiredNestedAssociate')) FROM [RootEntity] AS [r] @@ -256,6 +271,7 @@ public override async Task Update_associate_to_inline() """ @complex_type_p='{"Id":1000,"Int":70,"Ints":[1,2,4],"Name":"Updated associate name","String":"Updated associate string","NestedCollection":[],"OptionalNestedAssociate":null,"RequiredNestedAssociate":{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name","String":"Updated nested string"}}' (Size = 280) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = @complex_type_p FROM [RootEntity] AS [r] @@ -270,6 +286,7 @@ public override async Task Update_associate_to_inline_with_lambda() { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = CAST('{"Id":1000,"Int":70,"Ints":[1,2,4],"Name":"Updated associate name","String":"Updated associate string","NestedCollection":[],"OptionalNestedAssociate":null,"RequiredNestedAssociate":{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name","String":"Updated nested string"}}' AS json) FROM [RootEntity] AS [r] @@ -279,6 +296,7 @@ FROM [RootEntity] AS [r] { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = '{"Id":1000,"Int":70,"Ints":[1,2,4],"Name":"Updated associate name","String":"Updated associate string","NestedCollection":[],"OptionalNestedAssociate":null,"RequiredNestedAssociate":{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name","String":"Updated nested string"}}' FROM [RootEntity] AS [r] @@ -294,6 +312,7 @@ public override async Task Update_nested_associate_to_inline_with_lambda() { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.RequiredNestedAssociate', CAST('{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name","String":"Updated nested string"}' AS json)) FROM [RootEntity] AS [r] @@ -303,6 +322,7 @@ FROM [RootEntity] AS [r] { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.RequiredNestedAssociate', JSON_QUERY('{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name","String":"Updated nested string"}')) FROM [RootEntity] AS [r] @@ -316,6 +336,7 @@ public override async Task Update_associate_to_null() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate] = NULL FROM [RootEntity] AS [r] @@ -328,6 +349,7 @@ public override async Task Update_associate_to_null_with_lambda() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate] = NULL FROM [RootEntity] AS [r] @@ -340,6 +362,7 @@ public override async Task Update_associate_to_null_parameter() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate] = NULL FROM [RootEntity] AS [r] @@ -365,6 +388,7 @@ public override async Task Update_collection_to_parameter() """ @complex_type_p='[{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated associate name1","String":"Updated associate string1","NestedCollection":[],"OptionalNestedAssociate":null,"RequiredNestedAssociate":{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name1","String":"Updated nested string1"}},{"Id":1001,"Int":81,"Ints":[1,2,4],"Name":"Updated associate name2","String":"Updated associate string2","NestedCollection":[],"OptionalNestedAssociate":null,"RequiredNestedAssociate":{"Id":1001,"Int":81,"Ints":[1,2,4],"Name":"Updated nested name2","String":"Updated nested string2"}}]' (Size = 571) +SET NOCOUNT OFF; UPDATE [r] SET [r].[AssociateCollection] = @complex_type_p FROM [RootEntity] AS [r] @@ -381,6 +405,7 @@ public override async Task Update_nested_collection_to_parameter() """ @complex_type_p='[{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name1","String":"Updated nested string1"},{"Id":1001,"Int":81,"Ints":[1,2,4],"Name":"Updated nested name2","String":"Updated nested string2"}]' (Size = 201) +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.NestedCollection', @complex_type_p) FROM [RootEntity] AS [r] @@ -392,6 +417,7 @@ FROM [RootEntity] AS [r] """ @complex_type_p='[{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name1","String":"Updated nested string1"},{"Id":1001,"Int":81,"Ints":[1,2,4],"Name":"Updated nested name2","String":"Updated nested string2"}]' (Size = 201) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.NestedCollection', JSON_QUERY(@complex_type_p)) FROM [RootEntity] AS [r] @@ -407,6 +433,7 @@ public override async Task Update_nested_collection_to_inline_with_lambda() { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.NestedCollection', CAST('[{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name1","String":"Updated nested string1"},{"Id":1001,"Int":81,"Ints":[1,2,4],"Name":"Updated nested name2","String":"Updated nested string2"}]' AS json)) FROM [RootEntity] AS [r] @@ -416,6 +443,7 @@ FROM [RootEntity] AS [r] { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.NestedCollection', JSON_QUERY('[{"Id":1000,"Int":80,"Ints":[1,2,4],"Name":"Updated nested name1","String":"Updated nested string1"},{"Id":1001,"Int":81,"Ints":[1,2,4],"Name":"Updated nested name2","String":"Updated nested string2"}]')) FROM [RootEntity] AS [r] @@ -431,6 +459,7 @@ public override async Task Update_nested_collection_to_another_nested_collection { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.NestedCollection', JSON_QUERY([r].[OptionalAssociate], '$.NestedCollection')) FROM [RootEntity] AS [r] @@ -441,6 +470,7 @@ WHERE [r].[OptionalAssociate] IS NOT NULL { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.NestedCollection', JSON_QUERY([r].[OptionalAssociate], '$.NestedCollection')) FROM [RootEntity] AS [r] @@ -475,6 +505,7 @@ public override async Task Update_primitive_collection_to_constant() { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.Ints', CAST('[1,2,4]' AS json)) FROM [RootEntity] AS [r] @@ -484,6 +515,7 @@ FROM [RootEntity] AS [r] { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.Ints', JSON_QUERY(N'[1,2,4]')) FROM [RootEntity] AS [r] @@ -501,6 +533,7 @@ public override async Task Update_primitive_collection_to_parameter() """ @ints='[1,2,4]' (Size = 7) +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.Ints', @ints) FROM [RootEntity] AS [r] @@ -512,6 +545,7 @@ FROM [RootEntity] AS [r] """ @ints='[1,2,4]' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.Ints', JSON_QUERY(@ints)) FROM [RootEntity] AS [r] @@ -527,6 +561,7 @@ public override async Task Update_primitive_collection_to_another_collection() { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.OptionalNestedAssociate.Ints', JSON_QUERY([r].[RequiredAssociate], '$.RequiredNestedAssociate.Ints')) FROM [RootEntity] AS [r] @@ -536,6 +571,7 @@ FROM [RootEntity] AS [r] { AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.OptionalNestedAssociate.Ints', JSON_QUERY([r].[RequiredAssociate], '$.RequiredNestedAssociate.Ints')) FROM [RootEntity] AS [r] @@ -553,6 +589,7 @@ public override async Task Update_inside_primitive_collection() """ @p='99' +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.Ints[1]', @p) FROM [RootEntity] AS [r] @@ -567,6 +604,7 @@ FROM OPENJSON(JSON_QUERY([r].[RequiredAssociate], '$.Ints')) AS [i]) >= 2 """ @p='99' +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.Ints[1]', @p) FROM [RootEntity] AS [r] @@ -592,6 +630,7 @@ public override async Task Update_multiple_properties_inside_same_associate() @p='foo_updated' (Size = 4000) @p1='20' +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY(JSON_MODIFY([r].[RequiredAssociate], '$.String', @p), '$.Int', @p1) FROM [RootEntity] AS [r] @@ -608,6 +647,7 @@ public override async Task Update_multiple_properties_inside_associates_and_on_e """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[Name] = [r].[Name] + N'Modified', [RequiredAssociate].modify('$.String', JSON_VALUE([r].[OptionalAssociate], '$.String' RETURNING nvarchar(max))), @@ -622,6 +662,7 @@ WHERE [r].[OptionalAssociate] IS NOT NULL """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[Name] = [r].[Name] + N'Modified', [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.String', JSON_VALUE([r].[OptionalAssociate], '$.String')), @@ -642,6 +683,7 @@ public override async Task Update_multiple_projected_associates_via_anonymous_ty """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [RequiredAssociate].modify('$.String', JSON_VALUE([r].[OptionalAssociate], '$.String' RETURNING nvarchar(max))), [OptionalAssociate].modify('$.String', @p) @@ -655,6 +697,7 @@ WHERE [r].[OptionalAssociate] IS NOT NULL """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate] = JSON_MODIFY([r].[RequiredAssociate], '$.String', JSON_VALUE([r].[OptionalAssociate], '$.String')), [r].[OptionalAssociate] = JSON_MODIFY([r].[OptionalAssociate], '$.String', @p) diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingBulkUpdateSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingBulkUpdateSqlServerTest.cs index 1daa7300f77..41c11c2312b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingBulkUpdateSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/Associations/ComplexTableSplitting/ComplexTableSplittingBulkUpdateSqlServerTest.cs @@ -18,6 +18,7 @@ public override async Task Delete_entity_with_associations() """ @deletableEntity_Name='Root3_With_different_values' (Size = 4000) +SET NOCOUNT OFF; DELETE FROM [r] FROM [RootEntity] AS [r] WHERE [r].[Name] = @deletableEntity_Name @@ -50,6 +51,7 @@ public override async Task Update_property_inside_associate() """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_String] = @p FROM [RootEntity] AS [r] @@ -62,6 +64,7 @@ public override async Task Update_property_inside_associate_with_special_chars() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_String] = N'{ Some other/JSON:like text though it [isn''t]: ממש ממש לאéèéè }' FROM [RootEntity] AS [r] @@ -77,6 +80,7 @@ public override async Task Update_property_inside_nested_associate() """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_RequiredNestedAssociate_String] = @p FROM [RootEntity] AS [r] @@ -91,6 +95,7 @@ public override async Task Update_property_on_projected_associate() """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_String] = @p FROM [RootEntity] AS [r] @@ -132,6 +137,7 @@ public override async Task Update_associate_to_parameter() @complex_type_p_RequiredNestedAssociate_Name='Updated nested name' (Size = 4000) @complex_type_p_RequiredNestedAssociate_String='Updated nested string' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_Id] = @complex_type_p_Id, [r].[RequiredAssociate_Int] = @complex_type_p_Int, @@ -164,6 +170,7 @@ public override async Task Update_nested_associate_to_parameter() @complex_type_p_Name='Updated nested name' (Size = 4000) @complex_type_p_String='Updated nested string' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_RequiredNestedAssociate_Id] = @complex_type_p_Id, [r].[RequiredAssociate_RequiredNestedAssociate_Int] = @complex_type_p_Int, @@ -180,6 +187,7 @@ public override async Task Update_associate_to_another_associate() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate_Id] = [r].[RequiredAssociate_Id], [r].[OptionalAssociate_Int] = [r].[RequiredAssociate_Int], @@ -206,6 +214,7 @@ public override async Task Update_nested_associate_to_another_nested_associate() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_OptionalNestedAssociate_Id] = [r].[RequiredAssociate_RequiredNestedAssociate_Id], [r].[RequiredAssociate_OptionalNestedAssociate_Int] = [r].[RequiredAssociate_RequiredNestedAssociate_Int], @@ -233,6 +242,7 @@ public override async Task Update_associate_to_inline() @complex_type_p_RequiredNestedAssociate_Name='Updated nested name' (Size = 4000) @complex_type_p_RequiredNestedAssociate_String='Updated nested string' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_Id] = @complex_type_p_Id, [r].[RequiredAssociate_Int] = @complex_type_p_Int, @@ -259,6 +269,7 @@ public override async Task Update_associate_to_inline_with_lambda() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_Id] = 1000, [r].[RequiredAssociate_Int] = 70, @@ -285,6 +296,7 @@ public override async Task Update_nested_associate_to_inline_with_lambda() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_RequiredNestedAssociate_Id] = 1000, [r].[RequiredAssociate_RequiredNestedAssociate_Int] = 80, @@ -301,6 +313,7 @@ public override async Task Update_associate_to_null() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate_Id] = NULL, [r].[OptionalAssociate_Int] = NULL, @@ -327,6 +340,7 @@ public override async Task Update_associate_to_null_with_lambda() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate_Id] = NULL, [r].[OptionalAssociate_Int] = NULL, @@ -353,6 +367,7 @@ public override async Task Update_associate_to_null_parameter() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[OptionalAssociate_Id] = NULL, [r].[OptionalAssociate_Int] = NULL, @@ -436,6 +451,7 @@ public override async Task Update_primitive_collection_to_constant() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_Ints] = N'[1,2,4]' FROM [RootEntity] AS [r] @@ -450,6 +466,7 @@ public override async Task Update_primitive_collection_to_parameter() """ @ints='[1,2,4]' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_Ints] = @ints FROM [RootEntity] AS [r] @@ -462,6 +479,7 @@ public override async Task Update_primitive_collection_to_another_collection() AssertExecuteUpdateSql( """ +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_OptionalNestedAssociate_Ints] = [r].[RequiredAssociate_RequiredNestedAssociate_Ints] FROM [RootEntity] AS [r] @@ -476,6 +494,7 @@ public override async Task Update_inside_primitive_collection() """ @p='99' +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_Ints] = JSON_MODIFY([r].[RequiredAssociate_Ints], '$[1]', @p) FROM [RootEntity] AS [r] @@ -498,6 +517,7 @@ public override async Task Update_multiple_properties_inside_same_associate() @p='foo_updated' (Size = 4000) @p1='20' +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_String] = @p, [r].[RequiredAssociate_Int] = @p1 @@ -513,6 +533,7 @@ public override async Task Update_multiple_properties_inside_associates_and_on_e """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[Name] = [r].[Name] + N'Modified', [r].[RequiredAssociate_String] = [r].[OptionalAssociate_String], @@ -530,6 +551,7 @@ public override async Task Update_multiple_projected_associates_via_anonymous_ty """ @p='foo_updated' (Size = 4000) +SET NOCOUNT OFF; UPDATE [r] SET [r].[RequiredAssociate_String] = [r].[OptionalAssociate_String], [r].[OptionalAssociate_String] = @p diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/PrecompiledQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/PrecompiledQuerySqlServerTest.cs index ef813c77564..b14a941e999 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/PrecompiledQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/PrecompiledQuerySqlServerTest.cs @@ -1485,6 +1485,7 @@ public override async Task Terminating_ExecuteDelete() AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [b] FROM [Blogs] AS [b] WHERE [b].[Id] > 8 @@ -1502,6 +1503,7 @@ public override async Task Terminating_ExecuteDeleteAsync() AssertSql( """ +SET NOCOUNT OFF; DELETE FROM [b] FROM [Blogs] AS [b] WHERE [b].[Id] > 8 @@ -1521,6 +1523,7 @@ public override async Task Terminating_ExecuteUpdate_with_lambda() """ @suffix='Suffix' (Size = 4000) +SET NOCOUNT OFF; UPDATE [b] SET [b].[Name] = COALESCE([b].[Name], N'') + @suffix FROM [Blogs] AS [b] @@ -1542,6 +1545,7 @@ public override async Task Terminating_ExecuteUpdate_without_lambda() """ @newValue='NewValue' (Size = 4000) +SET NOCOUNT OFF; UPDATE [b] SET [b].[Name] = @newValue FROM [Blogs] AS [b] @@ -1563,6 +1567,7 @@ public override async Task Terminating_ExecuteUpdateAsync_with_lambda() """ @suffix='Suffix' (Size = 4000) +SET NOCOUNT OFF; UPDATE [b] SET [b].[Name] = COALESCE([b].[Name], N'') + @suffix FROM [Blogs] AS [b] @@ -1584,6 +1589,7 @@ public override async Task Terminating_ExecuteUpdateAsync_without_lambda() """ @newValue='NewValue' (Size = 4000) +SET NOCOUNT OFF; UPDATE [b] SET [b].[Name] = @newValue FROM [Blogs] AS [b] diff --git a/test/EFCore.SqlServer.FunctionalTests/TableSplittingSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/TableSplittingSqlServerTest.cs index e118d9ba864..2b62e3f56a2 100644 --- a/test/EFCore.SqlServer.FunctionalTests/TableSplittingSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/TableSplittingSqlServerTest.cs @@ -192,6 +192,7 @@ public override async Task ExecuteUpdate_works_for_table_sharing(bool async) """ @p='1' +SET NOCOUNT OFF; UPDATE [v] SET [v].[SeatingCapacity] = @p FROM [Vehicles] AS [v] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyCollectionTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyCollectionTypeTest.cs index c7fd7b6df6a..59d28a76749 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyCollectionTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyCollectionTypeTest.cs @@ -108,6 +108,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() LINESTRING (-121.9 46.95, -121.6 46.82) POLYGON ((-121.88 46.94, -121.88 46.92, -121.86 46.92, -121.86 46.94, -121.88 46.94)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -121,6 +122,7 @@ FROM [JsonTypeEntity] AS [j] LINESTRING (-121.9 46.95, -121.6 46.82) POLYGON ((-121.88 46.94, -121.88 46.92, -121.86 46.92, -121.86 46.94, -121.88 46.94)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +138,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'GEOMETRYCOLLECTION (POINT (-121.9 46.95), LINESTRING (-121.9 46.95, -121.6 46.82), POLYGON ((-121.88 46.94, -121.88 46.92, -121.86 46.92, -121.86 46.94, -121.88 46.94)))') FROM [JsonTypeEntity] AS [j] @@ -145,6 +148,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'GEOMETRYCOLLECTION (POINT (-121.9 46.95), LINESTRING (-121.9 46.95, -121.6 46.82), POLYGON ((-121.88 46.94, -121.88 46.92, -121.86 46.92, -121.86 46.94, -121.88 46.94)))') FROM [JsonTypeEntity] AS [j] @@ -160,6 +164,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -169,6 +174,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -191,6 +197,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -200,6 +207,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyLineStringTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyLineStringTypeTest.cs index 70c36b5d636..5b905941e22 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyLineStringTypeTest.cs @@ -104,6 +104,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='LINESTRING (-121.5 46.9, -121.2 46.65, -121 46.4)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -115,6 +116,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='LINESTRING (-121.5 46.9, -121.2 46.65, -121 46.4)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -130,6 +132,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'LINESTRING (-121.5 46.9, -121.2 46.65, -121 46.4)') FROM [JsonTypeEntity] AS [j] @@ -139,6 +142,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'LINESTRING (-121.5 46.9, -121.2 46.65, -121 46.4)') FROM [JsonTypeEntity] AS [j] @@ -154,6 +158,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -163,6 +168,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -185,6 +191,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -194,6 +201,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiLineStringTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiLineStringTypeTest.cs index 21569532e60..2fe6ce9529f 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiLineStringTypeTest.cs @@ -107,6 +107,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @complex_type_Fixture_OtherValue='MULTILINESTRING ((-121.9 46.95, -121.6 46.82) (-121.7 46.78, -121.4 46.55))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -119,6 +120,7 @@ FROM [JsonTypeEntity] AS [j] @complex_type_Fixture_OtherValue='MULTILINESTRING ((-121.9 46.95, -121.6 46.82) (-121.7 46.78, -121.4 46.55))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -134,6 +136,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'MULTILINESTRING ((-121.9 46.95, -121.6 46.82), (-121.7 46.78, -121.4 46.55))') FROM [JsonTypeEntity] AS [j] @@ -143,6 +146,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'MULTILINESTRING ((-121.9 46.95, -121.6 46.82), (-121.7 46.78, -121.4 46.55))') FROM [JsonTypeEntity] AS [j] @@ -158,6 +162,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -167,6 +172,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -189,6 +195,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -198,6 +205,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPointTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPointTypeTest.cs index 846c85f6bce..23376718736 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPointTypeTest.cs @@ -108,6 +108,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() (-121.5 46.6) (-121.2 46.3))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -121,6 +122,7 @@ FROM [JsonTypeEntity] AS [j] (-121.5 46.6) (-121.2 46.3))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +138,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'MULTIPOINT ((-121.9 46.95), (-121.5 46.6), (-121.2 46.3))') FROM [JsonTypeEntity] AS [j] @@ -145,6 +148,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'MULTIPOINT ((-121.9 46.95), (-121.5 46.6), (-121.2 46.3))') FROM [JsonTypeEntity] AS [j] @@ -160,6 +164,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -169,6 +174,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -191,6 +197,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -200,6 +207,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPolygonTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPolygonTypeTest.cs index 66bfd15a7ff..d60869eac23 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPolygonTypeTest.cs @@ -107,6 +107,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @complex_type_Fixture_OtherValue='MULTIPOLYGON (((-121.36 46.625, -121.36 46.62, -121.355 46.62, -121.355 46.625, -121.36 46.625)) ((-121.354 46.624, -121.354 46.622, -121.3525 46.622, -121.3525 46.624, -121.354 46.624)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -119,6 +120,7 @@ FROM [JsonTypeEntity] AS [j] @complex_type_Fixture_OtherValue='MULTIPOLYGON (((-121.36 46.625, -121.36 46.62, -121.355 46.62, -121.355 46.625, -121.36 46.625)) ((-121.354 46.624, -121.354 46.622, -121.3525 46.622, -121.3525 46.624, -121.354 46.624)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -134,6 +136,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'MULTIPOLYGON (((-121.36 46.625, -121.36 46.62, -121.355 46.62, -121.355 46.625, -121.36 46.625)), ((-121.354 46.624, -121.354 46.622, -121.3525 46.622, -121.3525 46.624, -121.354 46.624)))') FROM [JsonTypeEntity] AS [j] @@ -143,6 +146,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'MULTIPOLYGON (((-121.36 46.625, -121.36 46.62, -121.355 46.62, -121.355 46.625, -121.36 46.625)), ((-121.354 46.624, -121.354 46.622, -121.3525 46.622, -121.3525 46.624, -121.354 46.624)))') FROM [JsonTypeEntity] AS [j] @@ -158,6 +162,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -167,6 +172,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -189,6 +195,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -198,6 +205,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPointTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPointTypeTest.cs index 29deba43527..068ec4a8693 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPointTypeTest.cs @@ -102,6 +102,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='POINT (-121.75 46.25)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -113,6 +114,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='POINT (-121.75 46.25)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -128,6 +130,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'POINT (-121.75 46.25)') FROM [JsonTypeEntity] AS [j] @@ -137,6 +140,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'POINT (-121.75 46.25)') FROM [JsonTypeEntity] AS [j] @@ -152,6 +156,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -161,6 +166,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -183,6 +189,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -192,6 +199,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPolygonTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPolygonTypeTest.cs index 8446c212c35..179ed9bfa66 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPolygonTypeTest.cs @@ -102,6 +102,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='POLYGON ((-121.3 46.6, -121.3 46.59, -121.28 46.59, -121.28 46.6, -121.3 46.6))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -113,6 +114,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='POLYGON ((-121.3 46.6, -121.3 46.59, -121.28 46.59, -121.28 46.6, -121.3 46.6))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -128,6 +130,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'POLYGON ((-121.3 46.6, -121.3 46.59, -121.28 46.59, -121.28 46.6, -121.3 46.6))') FROM [JsonTypeEntity] AS [j] @@ -137,6 +140,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'POLYGON ((-121.3 46.6, -121.3 46.59, -121.28 46.59, -121.28 46.6, -121.3 46.6))') FROM [JsonTypeEntity] AS [j] @@ -152,6 +156,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -161,6 +166,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -183,6 +189,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -192,6 +199,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryCollectionTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryCollectionTypeTest.cs index 3244e9bd59d..ea0363787e2 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryCollectionTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryCollectionTypeTest.cs @@ -108,6 +108,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() LINESTRING (11 11, 12 12) POLYGON ((13 13, 13 15, 15 15, 15 13, 13 13)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -121,6 +122,7 @@ FROM [JsonTypeEntity] AS [j] LINESTRING (11 11, 12 12) POLYGON ((13 13, 13 15, 15 15, 15 13, 13 13)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +138,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'GEOMETRYCOLLECTION (POINT (10 10), LINESTRING (11 11, 12 12), POLYGON ((13 13, 13 15, 15 15, 15 13, 13 13)))') FROM [JsonTypeEntity] AS [j] @@ -145,6 +148,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'GEOMETRYCOLLECTION (POINT (10 10), LINESTRING (11 11, 12 12), POLYGON ((13 13, 13 15, 15 15, 15 13, 13 13)))') FROM [JsonTypeEntity] AS [j] @@ -160,6 +164,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -169,6 +174,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -191,6 +197,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -200,6 +207,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryLineStringTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryLineStringTypeTest.cs index 8a197cfbdca..f267f7ee0dc 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryLineStringTypeTest.cs @@ -104,6 +104,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='LINESTRING (30 40, 35 45, 40 50)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -115,6 +116,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='LINESTRING (30 40, 35 45, 40 50)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -130,6 +132,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'LINESTRING (30 40, 35 45, 40 50)') FROM [JsonTypeEntity] AS [j] @@ -139,6 +142,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'LINESTRING (30 40, 35 45, 40 50)') FROM [JsonTypeEntity] AS [j] @@ -154,6 +158,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -163,6 +168,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -185,6 +191,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -194,6 +201,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiLineStringTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiLineStringTypeTest.cs index a6feb6fdbc2..e4c17770c39 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiLineStringTypeTest.cs @@ -107,6 +107,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @complex_type_Fixture_OtherValue='MULTILINESTRING ((10 10, 11 11) (12 12, 13 13))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -119,6 +120,7 @@ FROM [JsonTypeEntity] AS [j] @complex_type_Fixture_OtherValue='MULTILINESTRING ((10 10, 11 11) (12 12, 13 13))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -134,6 +136,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'MULTILINESTRING ((10 10, 11 11), (12 12, 13 13))') FROM [JsonTypeEntity] AS [j] @@ -143,6 +146,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'MULTILINESTRING ((10 10, 11 11), (12 12, 13 13))') FROM [JsonTypeEntity] AS [j] @@ -158,6 +162,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -167,6 +172,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -189,6 +195,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -198,6 +205,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPointTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPointTypeTest.cs index 266b683a295..7e8bf00b1fc 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPointTypeTest.cs @@ -108,6 +108,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() (20 20) (25 25))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -121,6 +122,7 @@ FROM [JsonTypeEntity] AS [j] (20 20) (25 25))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +138,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'MULTIPOINT ((15 15), (20 20), (25 25))') FROM [JsonTypeEntity] AS [j] @@ -145,6 +148,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'MULTIPOINT ((15 15), (20 20), (25 25))') FROM [JsonTypeEntity] AS [j] @@ -160,6 +164,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -169,6 +174,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -191,6 +197,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -200,6 +207,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPolygonTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPolygonTypeTest.cs index a8bb311c29d..527c9bcb1db 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPolygonTypeTest.cs @@ -107,6 +107,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() @complex_type_Fixture_OtherValue='MULTIPOLYGON (((20 20, 20 25, 25 25, 25 20, 20 20)) ((30 30, 30 35, 35 35, 35 30, 30 30)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -119,6 +120,7 @@ FROM [JsonTypeEntity] AS [j] @complex_type_Fixture_OtherValue='MULTIPOLYGON (((20 20, 20 25, 25 25, 25 20, 20 20)) ((30 30, 30 35, 35 35, 35 30, 30 30)))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -134,6 +136,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'MULTIPOLYGON (((20 20, 20 25, 25 25, 25 20, 20 20)), ((30 30, 30 35, 35 35, 35 30, 30 30)))') FROM [JsonTypeEntity] AS [j] @@ -143,6 +146,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'MULTIPOLYGON (((20 20, 20 25, 25 25, 25 20, 20 20)), ((30 30, 30 35, 35 35, 35 30, 30 30)))') FROM [JsonTypeEntity] AS [j] @@ -158,6 +162,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -167,6 +172,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -189,6 +195,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -198,6 +205,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPointTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPointTypeTest.cs index ceb8ee49c70..86a4fa2a842 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPointTypeTest.cs @@ -102,6 +102,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='POINT (30 40)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -113,6 +114,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='POINT (30 40)' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -128,6 +130,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'POINT (30 40)') FROM [JsonTypeEntity] AS [j] @@ -137,6 +140,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'POINT (30 40)') FROM [JsonTypeEntity] AS [j] @@ -152,6 +156,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -161,6 +166,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -183,6 +189,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -192,6 +199,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPolygonTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPolygonTypeTest.cs index 57c655112b2..330ef5b5e57 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPolygonTypeTest.cs @@ -102,6 +102,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='POLYGON ((20 20, 20 30, 30 30, 30 20, 20 20))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -113,6 +114,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='POLYGON ((20 20, 20 30, 30 30, 30 20, 20 20))' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -128,6 +130,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'POLYGON ((20 20, 20 30, 30 30, 30 20, 20 20))') FROM [JsonTypeEntity] AS [j] @@ -137,6 +140,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'POLYGON ((20 20, 20 30, 30 30, 30 20, 20 20))') FROM [JsonTypeEntity] AS [j] @@ -152,6 +156,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -161,6 +166,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -183,6 +189,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] @@ -192,6 +199,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue].STAsText()) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerBoolTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerBoolTypeTest.cs index 8025ab93915..8eb12f7e571 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerBoolTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerBoolTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='False' +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='False' +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', CAST(0 AS bit)) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(0 AS bit)) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING bit)) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS bit)) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerByteArrayTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerByteArrayTypeTest.cs index 469a981086c..77e3de7c6bd 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerByteArrayTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerByteArrayTypeTest.cs @@ -103,6 +103,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='BAUGBw==' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -114,6 +115,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='BAUGBw==' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -129,6 +131,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'BAUGBw==') FROM [JsonTypeEntity] AS [j] @@ -138,6 +141,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'BAUGBw==') FROM [JsonTypeEntity] AS [j] @@ -153,6 +157,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -162,6 +167,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -184,6 +190,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -193,6 +200,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerGuidTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerGuidTypeTest.cs index 73014d02985..bbb9eeb8bd1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerGuidTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerGuidTypeTest.cs @@ -113,6 +113,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='ae192c36-9004-49b2-b785-8be10d169627' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -124,6 +125,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='ae192c36-9004-49b2-b785-8be10d169627' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -139,6 +141,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'ae192c36-9004-49b2-b785-8be10d169627') FROM [JsonTypeEntity] AS [j] @@ -148,6 +151,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'ae192c36-9004-49b2-b785-8be10d169627') FROM [JsonTypeEntity] AS [j] @@ -163,6 +167,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -172,6 +177,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -194,6 +200,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -203,6 +210,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerStringTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerStringTypeTest.cs index b4f7f082b0a..da231f32fb4 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerStringTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='bar' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='bar' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'bar') FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'bar') FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerByteTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerByteTypeTest.cs index dac36a40c40..e5c3783a6f3 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerByteTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerByteTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='255' (Size = 1) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='255' (Size = 1) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', CAST(255 AS tinyint)) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(255 AS tinyint)) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING tinyint)) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS tinyint)) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDecimalTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDecimalTypeTest.cs index 6065393c696..6b734a10592 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDecimalTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDecimalTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='30' (Precision = 18) (Scale = 2) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='30' (Precision = 18) (Scale = 2) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', 30.0) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', 30.0) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING decimal(18,2))) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS decimal(18,2))) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDoubleTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDoubleTypeTest.cs index 8925d8c3552..9f627bd1d49 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDoubleTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDoubleTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='30' +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='30' +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', 30.0E0) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', 30.0E0) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING float)) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS float)) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerFloatTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerFloatTypeTest.cs index 67f5f967a46..3232ef829e8 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerFloatTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerFloatTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='30' +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='30' +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', CAST(30 AS real)) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(30 AS real)) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING real)) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS real)) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerIntTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerIntTypeTest.cs index ee0783fb72d..2968e922869 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerIntTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerIntTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='2147483647' +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='2147483647' +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', 2147483647) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', 2147483647) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING int)) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS int)) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerLongTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerLongTypeTest.cs index 2e933a631c0..53b89555f46 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerLongTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerLongTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='9223372036854775807' +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='9223372036854775807' +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', CAST(9223372036854775807 AS bigint)) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(9223372036854775807 AS bigint)) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING bigint)) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS bigint)) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerShortTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerShortTypeTest.cs index 27f85c212de..0a07fc4286a 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerShortTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerShortTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @Fixture_OtherValue='32767' +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @Fixture_OtherValue='32767' +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', CAST(32767 AS smallint)) FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(32767 AS smallint)) FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING smallint)) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', CAST(JSON_VALUE([j].[JsonContainer], '$.OtherValue') AS smallint)) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', [j].[OtherValue]) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateOnlyTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateOnlyTypeTest.cs index 0ac184348ee..58588e99ebe 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateOnlyTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateOnlyTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='2022-05-03' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='2022-05-03' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'2022-05-03') FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'2022-05-03') FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTime2TypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTime2TypeTest.cs index 922fbc08cbc..94692c61276 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTime2TypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTime2TypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='2022-05-03T00:00:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='2022-05-03T00:00:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'2022-05-03T00:00:00') FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'2022-05-03T00:00:00') FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeOffsetTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeOffsetTypeTest.cs index f3ef1cfdfbe..a36daff29a9 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeOffsetTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeOffsetTypeTest.cs @@ -127,6 +127,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='2020-01-05T12:30:45+03:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -138,6 +139,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='2020-01-05T12:30:45+03:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -153,6 +155,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'2020-01-05T12:30:45+03:00') FROM [JsonTypeEntity] AS [j] @@ -162,6 +165,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'2020-01-05T12:30:45+03:00') FROM [JsonTypeEntity] AS [j] @@ -177,6 +181,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -186,6 +191,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -208,6 +214,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -217,6 +224,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeTypeTest.cs index f8e9fc3ec07..4aae4a0c49d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeTypeTest.cs @@ -111,6 +111,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='2022-05-03T00:00:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -122,6 +123,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='2022-05-03T00:00:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -137,6 +139,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'2022-05-03T00:00:00') FROM [JsonTypeEntity] AS [j] @@ -146,6 +149,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'2022-05-03T00:00:00') FROM [JsonTypeEntity] AS [j] @@ -161,6 +165,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -170,6 +175,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -192,6 +198,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -201,6 +208,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeOnlyTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeOnlyTypeTest.cs index 494dd7fb234..01fffaf7413 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeOnlyTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeOnlyTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='14:00:00.0000000' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='14:00:00.0000000' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'14:00:00.0000000') FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'14:00:00.0000000') FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] diff --git a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeSpanTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeSpanTypeTest.cs index e7d60503654..ac8081d0e01 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeSpanTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeSpanTypeTest.cs @@ -125,6 +125,7 @@ public override async Task ExecuteUpdate_within_json_to_parameter() """ @complex_type_Fixture_OtherValue='14:00:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -136,6 +137,7 @@ FROM [JsonTypeEntity] AS [j] """ @complex_type_Fixture_OtherValue='14:00:00' (Size = 4000) +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', @complex_type_Fixture_OtherValue) FROM [JsonTypeEntity] AS [j] @@ -151,6 +153,7 @@ public override async Task ExecuteUpdate_within_json_to_constant() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', N'14:00:00') FROM [JsonTypeEntity] AS [j] @@ -160,6 +163,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', N'14:00:00') FROM [JsonTypeEntity] AS [j] @@ -175,6 +179,7 @@ public override async Task ExecuteUpdate_within_json_to_another_json_property() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue' RETURNING nvarchar(max))) FROM [JsonTypeEntity] AS [j] @@ -184,6 +189,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE([j].[JsonContainer], '$.OtherValue')) FROM [JsonTypeEntity] AS [j] @@ -206,6 +212,7 @@ public override async Task ExecuteUpdate_within_json_to_nonjson_column() { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [JsonContainer].modify('$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j] @@ -215,6 +222,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', JSON_VALUE(JSON_OBJECT('v': [j].[OtherValue]), '$.v')) FROM [JsonTypeEntity] AS [j]