diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerQuerySqlGenerator.cs index 03fdbbd3b48..0268a7a0781 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 @@ -287,6 +289,8 @@ SqlExpression topN /// 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 8fade1611ae..73f360df986 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 b950a839e81..ea804825267 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 2254259b20f..71738d5d72e 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 82ab85e99a0..f7e03416353 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 5b847c205c4..135c28b3bb5 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 6f087a2954a..bc176118330 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 643f4c3b69f..9276d7ac777 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 dceebdc2e9d..6f9c8ae2625 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] RIGHT JOIN ( @@ -639,6 +674,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] @@ -654,6 +690,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] @@ -668,6 +705,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] @@ -681,6 +719,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] @@ -697,6 +736,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] @@ -720,6 +760,7 @@ FROM [Customers] AS [c] """ @p='Updated' (Size = 30) +SET NOCOUNT OFF; UPDATE [c] SET [c].[ContactName] = @p FROM [Customers] AS [c] @@ -735,6 +776,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] @@ -750,6 +792,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] @@ -765,6 +808,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] @@ -780,6 +824,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] @@ -796,6 +841,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] @@ -818,6 +864,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] @@ -835,6 +882,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] @@ -856,6 +904,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] @@ -876,6 +925,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] @@ -898,6 +948,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] @@ -920,6 +971,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] @@ -943,6 +995,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] @@ -969,6 +1022,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] @@ -988,6 +1042,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] @@ -1017,6 +1072,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] @@ -1041,6 +1097,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] @@ -1058,6 +1115,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] @@ -1074,6 +1132,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] @@ -1089,6 +1148,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] @@ -1103,6 +1163,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] @@ -1118,6 +1179,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] @@ -1131,6 +1193,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] @@ -1146,6 +1209,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] @@ -1159,6 +1223,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] @@ -1182,6 +1247,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 @@ -1219,6 +1285,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] @@ -1242,6 +1309,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] @@ -1265,6 +1333,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] @@ -1288,6 +1357,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] @@ -1311,6 +1381,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] @@ -1331,6 +1402,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] @@ -1351,6 +1423,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] @@ -1371,6 +1444,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 [o] SET [o].[OrderDate] = @p FROM [Orders] AS [o] @@ -1391,6 +1465,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] @@ -1411,6 +1486,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] @@ -1431,6 +1507,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] @@ -1451,6 +1528,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] @@ -1476,6 +1554,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] @@ -1501,6 +1580,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] @@ -1531,6 +1611,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] @@ -1553,6 +1634,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] @@ -1570,6 +1652,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] @@ -1588,6 +1671,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] @@ -1608,6 +1692,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] @@ -1627,6 +1712,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 @@ -1645,6 +1731,40 @@ OFFSET @p ROWS """); } + [ConditionalFact] + public virtual async Task ExecuteUpdate_after_empty_insert_on_open_connection_returns_correct_rows_affected_Final() + { + 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); @@ -1653,6 +1773,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] @@ -1667,6 +1788,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 894e1d97cde..af6f7ed24ca 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 e8bf33ccc80..dd654e97dde 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 f7d013e0b75..c938f149644 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 bd39833fb36..6d2ad547428 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyCollectionTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyCollectionTypeTest.cs @@ -107,6 +107,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] @@ -120,6 +121,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] @@ -135,6 +137,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] @@ -144,6 +147,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] @@ -159,6 +163,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] @@ -168,6 +173,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] @@ -190,6 +196,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] @@ -199,6 +206,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 84f3a426f03..7ccd0d9fc40 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyLineStringTypeTest.cs @@ -103,6 +103,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] @@ -114,6 +115,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] @@ -129,6 +131,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] @@ -138,6 +141,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] @@ -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', [j].[OtherValue].STAsText()) 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', [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 e81f7fef5ee..d58aec19495 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiLineStringTypeTest.cs @@ -106,6 +106,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] @@ -118,6 +119,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] @@ -133,6 +135,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] @@ -142,6 +145,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] @@ -157,6 +161,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] @@ -166,6 +171,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] @@ -188,6 +194,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] @@ -197,6 +204,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 18625cd14f2..d945334949f 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPointTypeTest.cs @@ -107,6 +107,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] @@ -120,6 +121,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] @@ -135,6 +137,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] @@ -144,6 +147,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] @@ -159,6 +163,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] @@ -168,6 +173,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] @@ -190,6 +196,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] @@ -199,6 +206,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 f07b3326ee7..f056d051925 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyMultiPolygonTypeTest.cs @@ -106,6 +106,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] @@ -118,6 +119,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] @@ -133,6 +135,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] @@ -142,6 +145,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] @@ -157,6 +161,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] @@ -166,6 +171,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] @@ -188,6 +194,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] @@ -197,6 +204,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 591bd268852..b1a54459d80 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPointTypeTest.cs @@ -101,6 +101,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] @@ -112,6 +113,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] @@ -127,6 +129,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] @@ -136,6 +139,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] @@ -151,6 +155,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] @@ -160,6 +165,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] @@ -182,6 +188,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] @@ -191,6 +198,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 e212a734215..86aebf2a26b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geography/SqlServerGeographyPolygonTypeTest.cs @@ -101,6 +101,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] @@ -112,6 +113,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] @@ -127,6 +129,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] @@ -136,6 +139,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] @@ -151,6 +155,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] @@ -160,6 +165,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] @@ -182,6 +188,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] @@ -191,6 +198,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 8f33d2fd69a..773ae8d4f9c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryCollectionTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryCollectionTypeTest.cs @@ -107,6 +107,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] @@ -120,6 +121,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] @@ -135,6 +137,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] @@ -144,6 +147,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] @@ -159,6 +163,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] @@ -168,6 +173,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] @@ -190,6 +196,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] @@ -199,6 +206,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 aa03597dce2..d406d7feabf 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryLineStringTypeTest.cs @@ -103,6 +103,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] @@ -114,6 +115,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] @@ -129,6 +131,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] @@ -138,6 +141,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] @@ -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', [j].[OtherValue].STAsText()) 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', [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 1c14e65b325..2c0d93f49e1 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiLineStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiLineStringTypeTest.cs @@ -106,6 +106,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] @@ -118,6 +119,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] @@ -133,6 +135,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] @@ -142,6 +145,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] @@ -157,6 +161,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] @@ -166,6 +171,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] @@ -188,6 +194,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] @@ -197,6 +204,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 73ad92f7866..384f788eea9 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPointTypeTest.cs @@ -107,6 +107,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] @@ -120,6 +121,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] @@ -135,6 +137,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] @@ -144,6 +147,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] @@ -159,6 +163,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] @@ -168,6 +173,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] @@ -190,6 +196,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] @@ -199,6 +206,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 6d469041f56..1a7902eebca 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryMultiPolygonTypeTest.cs @@ -106,6 +106,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] @@ -118,6 +119,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] @@ -133,6 +135,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] @@ -142,6 +145,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] @@ -157,6 +161,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] @@ -166,6 +171,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] @@ -188,6 +194,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] @@ -197,6 +204,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 aca36803649..e504ad25a6e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPointTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPointTypeTest.cs @@ -101,6 +101,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] @@ -112,6 +113,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] @@ -127,6 +129,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] @@ -136,6 +139,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] @@ -151,6 +155,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] @@ -160,6 +165,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] @@ -182,6 +188,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] @@ -191,6 +198,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 5604bc978a6..f1fbc51f7df 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPolygonTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Geometry/SqlServerGeometryPolygonTypeTest.cs @@ -101,6 +101,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] @@ -112,6 +113,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] @@ -127,6 +129,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] @@ -136,6 +139,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] @@ -151,6 +155,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] @@ -160,6 +165,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] @@ -182,6 +188,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] @@ -191,6 +198,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 526afec5e4f..aeee06e19a5 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerBoolTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerBoolTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 a5abf44d4a9..2b9eab72450 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerByteArrayTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerByteArrayTypeTest.cs @@ -101,6 +101,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] @@ -112,6 +113,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] @@ -127,6 +129,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] @@ -136,6 +139,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] @@ -151,6 +155,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] @@ -160,6 +165,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] @@ -182,6 +188,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] @@ -191,6 +198,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 37cd7611ee0..668167291a9 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerGuidTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerGuidTypeTest.cs @@ -111,6 +111,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] @@ -122,6 +123,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] @@ -137,6 +139,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] @@ -146,6 +149,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] @@ -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/Miscellaneous/SqlServerStringTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerStringTypeTest.cs index de7c4ad1a55..8c912d12ef4 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerStringTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Miscellaneous/SqlServerStringTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 ae2af082c14..2f082bd3f8f 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerByteTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerByteTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 3191fc55837..caba4f2b586 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDecimalTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDecimalTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 4d701563294..80b7dc5b888 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDoubleTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerDoubleTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 710f12b69a3..f797cfb28c2 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerFloatTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerFloatTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 41f21ca407c..39ccad43ba2 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerIntTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerIntTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,7 @@ FROM [JsonTypeEntity] AS [j] { AssertSql( """ +SET NOCOUNT OFF; UPDATE [j] SET [j].[JsonContainer] = JSON_MODIFY([j].[JsonContainer], '$.Value', 2147483647) FROM [JsonTypeEntity] AS [j] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 e14e9de07f1..a84280d4dbb 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerLongTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerLongTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 7c1d778ef74..449487dd92e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerShortTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Numeric/SqlServerShortTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 1f4d8c6850f..82a72048663 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateOnlyTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateOnlyTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 780698d5c05..45c74b42377 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTime2TypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTime2TypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 8382454ca32..b9fc3824a23 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeOffsetTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeOffsetTypeTest.cs @@ -125,6 +125,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] @@ -136,6 +137,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] @@ -151,6 +153,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] @@ -160,6 +163,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] @@ -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/SqlServerDateTimeTypeTest.cs b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeTypeTest.cs index d3b4f2707ff..3139dfaf6a4 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerDateTimeTypeTest.cs @@ -109,6 +109,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] @@ -120,6 +121,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] @@ -135,6 +137,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] @@ -144,6 +147,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] @@ -159,6 +163,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] @@ -168,6 +173,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] @@ -190,6 +196,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] @@ -199,6 +206,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 3f74e450b67..808d4f7c35a 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeOnlyTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeOnlyTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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 cbbf85edc4b..4b09aae672c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeSpanTypeTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Types/Temporal/SqlServerTimeSpanTypeTest.cs @@ -123,6 +123,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] @@ -134,6 +135,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] @@ -149,6 +151,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] @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -182,6 +187,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] @@ -204,6 +210,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] @@ -213,6 +220,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]