You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hoping support for MergeRequest can be added, so the SQL4CDS tool can initiate bulk merges based on conditions.
Syntax perhaps looking something like this:
DECLARE @contact AS EntityReference = CREATELOOKUP('contact', '{myid}');
DECLARE @contact_dupe AS EntityReference = CREATELOOKUP('contact', '{myid}');
EXECUTE [dbo].[Merge]
@Target = @contact, -- or using CREATELOOKUP(...)
@SubordinateId = @contact_dupe,
@PerformParentingChecks =1,
@UpdateContent = ('emailaddress1', 'firstname')
Understanding that @Target is of type Entity in the SDK may also prove troublesome, but it seems that it may be irrelevant to the merge process and is only used as an EntityReference behind the scenes
The @UpdateContent parameter here is likely the trickiest and may require some custom syntax. The syntax in the above example would copy the values in the listed fields from the subordinate to the target. Syntax like the below example could allow for more dynamic values
The Target parameter is an EntityReference type, so that's no problem. As you say, the difficulty here is the UpdateContent parameter.
Custom syntax is not an option - SQL 4 CDS uses the standard T-SQL parser, so any syntax must be compatible with that. The standard SQL Server way of passing a data record into a stored procedure is to declare a custom table type variable, so the syntax would be more like:
Hoping support for MergeRequest can be added, so the SQL4CDS tool can initiate bulk merges based on conditions.
Syntax perhaps looking something like this:
Understanding that
@Target
is of typeEntity
in the SDK may also prove troublesome, but it seems that it may be irrelevant to the merge process and is only used as anEntityReference
behind the scenesThe
@UpdateContent
parameter here is likely the trickiest and may require some custom syntax. The syntax in the above example would copy the values in the listed fields from the subordinate to the target. Syntax like the below example could allow for more dynamic valuesThe text was updated successfully, but these errors were encountered: