Data is not sync from Member to Hub db.

Akash Patel 0 Reputation points
2025-11-24T17:35:53.95+00:00

I already configured column and table in sync group but data is only updating when I execute SQL query manually but If I performed scenario from .NET application then sync is not working (.NET Framework with EF). I checked that azure sql trace and found that insert query but nothing updated in HUB db table. I execute the query on Member DB table.

Here is the insert query i can see in SQL trace (from HUB db Server):

declare @p3 DataSync.Client_dss_BulkType_98087373-6da6-4ec4-88d9-31992cc20798

insert into @p3 values('BC3BD3A3-132B-4F93-8076-93E0332D3D19','A87E9A3A-E4A0-4121-BE07-DFB0E9D245BC',N'VendorID',N'Demo_Provider_AP_TEST222',N'http://localhost.com',NULL,NULL,N'V2',NULL,NULL,NULL,NULL,NULL,NULL,1,0,0,NULL,'2026-11-19 21:49:24.0230000',N'confidential',N'native',N'Created via Dev Portal ',1,'2025-11-19 21:49:24.0230000',NULL,'2025-11-21 16:53:08.6770000',NULL,2,0,N'DowntownClient',N'Provider',NULL,40476678,1,39747042,1)

exec [DataSync].[Client_dss_bulkupdate_98087373-6da6-4ec4-88d9-31992cc20798] @sync_min_timestamp=1327624444,@sync_scope_local_id=21,@changeTable=@p3

I think update triggered is fired that's why it is showing insert query on SQL trace so apart from this, Is there thing I need to verify ?

Note: Biredirectional sync configured.

Azure SQL Database
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-24T17:36:08.2433333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It sounds like you are experiencing issues with data synchronization from the Member database to the Hub database in Azure SQL Data Sync. Here are some things you can verify:

    1. Check for Circular References: Ensure that there are no circular references in your sync groups, as these can cause sync issues. Any row that is synced by one sync group should not be synced by another.
    2. Primary Key Requirement: Verify that all tables involved in the sync have a primary key defined. If the primary key is changed, it can lead to data loss or sync failures.
    3. Data Types and Constraints: Make sure that the data types of the columns being synced are compatible and that there are no constraints (like CHECK constraints) that could prevent the data from being inserted into the Hub database.
    4. Sync Status: Check the status of your sync group in the Azure portal. If it is in a processing state, it may need to be reset. You can create a post in the Microsoft Q&A question page for Azure SQL Database to have the sync group status reset.
    5. SQL Trace: Since you mentioned that you see an insert query in the SQL trace, ensure that the insert operation is not being blocked by any triggers or constraints in the Hub database that might prevent the data from being updated.
    6. Manual Testing: If possible, try to manually insert data into the Hub database to confirm that it can accept data without issues. This can help isolate whether the problem is with the .NET application or with the sync configuration itself.
    7. EF Configuration: Review your Entity Framework configuration to ensure that it is set up correctly to handle the data sync operations. Sometimes, the way EF manages context and transactions can affect how data is sent to the database.

    By checking these areas, you may be able to identify the root cause of the synchronization issue you are experiencing.


    References:

    0 comments No comments

  2. Alberto Morillo 35,401 Reputation points MVP Volunteer Moderator
    2025-11-24T21:40:25.3766667+00:00

    Try to disable key constraints on the tables involved temporarily to see if that allows the INSERT statement to be successful.

    In addition, as you can read here, if your .NET code uses anything like: SqlBulkCopy, A “BulkInsert” extension/library or a custom BULK INSERT command then by default, triggers don’t fire unless the FIRE_TRIGGERS option is used. Data Sync relies entirely on those insert/update/delete triggers to track changes.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.