web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Sync-NavApp Issue where the SQL query running in back end is Suspended

(1) ShareShare
ReportReport
Posted on by 2
Hi,
I am getting an issue on upgrading from BC14 Spring to BC25 on-premise. Eventually the database will go to a SaaS environment. I am in the process of moving the C/AL to AL and I am executing the Synch-NavApp command in Task 14 (The second version of the Empy Migration App): 
 
 
Sync-NAVApp -ServerInstance BC252 -Tenant Default -Name "bc14baseapptablesonly" -Version 2.0.0.0
 
This is moving data from the Main table to the Base tables and the Extension tables. After about 20 mins the SQL query on the back end is in a suspended state and when run a few times it always stops at this query:
 
MERGE INTO "dbo"."MyCOMPANY$G_L Entry$437dbf0e-84ff-417a-965d-ed2bb9650972$ext" AS [dst] USING "dbo"."TEMP$MyCOMPANY$G_L Entry$7842b442-a286-4b31-a2d9-553216ee8bed" AS [src] ON "dst"."Entry No_" = "src"."Entry No_" WHEN MATCHED THEN UPDATE SET "Entry No_" = "src"."Entry No_", "Member No_ TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa" = "src"."Member No_", "Shortcut Dimension 3 Code TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa" = "src"."Shortcut Dimension 3 Code", "Shortcut Dimension 4 Code TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa" = "src"."Shortcut Dimension 4 Code", "Description 2 TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa" = "src"."Description 2", "MyCOMPANY D_ Debit Mandate ID TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa" = "src"."MyCOMPANY Direct Debit Mandate ID", "ADDACS Reference Code TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa" = "src"."ADDACS Reference Code", "Service Type TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa" = "src"."Service Type" WHEN NOT MATCHED THEN INSERT ("Entry No_", "Member No_ TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa", "Shortcut Dimension 3 Code TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa", "Shortcut Dimension 4 Code TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa", "Description 2 TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa", "MyCOMPANY D_ Debit Mandate ID TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa", "ADDACS Reference Code TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa", "Service Type TNP$dc94960c-1fc9-45c6-9350-90a9544fb0aa") VALUES ("src"."Entry No_", "src"."Member No_", "src"."Shortcut Dimension 3 Code", "src"."Shortcut Dimension 4 Code", "src"."Description 2", "src"."MyCOMPANY Direct Debit Mandate ID", "src"."ADDACS Reference Code", "src"."Service Type");
 
I extract the above using this SQL query:
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
 
I have no idea if it is actually this query causing the issue or anything else. All my empty apps and BC25 Apps are synchronised. 
 
I have checked all Empty extensions and Custom Extensions and all look good and all the fields exist. Has anyone come across this or can advise?
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    1,886 on at
    Sync-NavApp Issue where the SQL query running in back end is Suspended
    Hello,
     
    The MERGE is stuck because SQL is waiting, usually from blocking or missing indexes on "Entry No_".
     
    Ensure no other sessions access the DB.
     
    Add an index on "Entry No_" in the temp table.
     
    Update stats (EXEC sp_updatestats;).
     
    Then rerun Sync-NAVApp.
     
    Regards,
    Oussama Sabbouh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,179

#2
OussamaSabbouh Profile Picture

OussamaSabbouh 1,999

#3
YUN ZHU Profile Picture

YUN ZHU 1,892 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans