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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Migration BC14 to BC 17.2 Invalid object name 'dbo.Country_Region

(0) ShareShare
ReportReport
Posted on by 20

Hello,

I'm in process of migration BC14 to bc 17.2.
In [Task 12(docs.microsoft.com/.../upgrade-to-microsoft-base-app-v17 at the step 6, I do a Sync-NAVApp (Second version of the table migration extension (empty version)).

Then i have the followin error.

pastedimage1608946888054v1.png

Any clue where it comes from ? I ran a SQL profiler but I did non see anything there.

I confirm that the table is pressent. And when a run the statement shown in the eventviewer, it work from SSMS. 

The instance is connected with Network Services and the looged user and Network Services are sysadmins in SQL. 

Moreover i put the timeouts longer : 

pastedimage1608947192345v1.png


Server instance: BC170
Tenant ID: default
Environment Name: 
Environment Type: Production
Session type: Background
Session ID: 15
User: WIN10X64EN\WIN7X64
Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavSqlException
ErrorNumber: 208
TransactionRolledBack: False
ErrorCode: -1
SuppressMessage: False
ContainsPersonalOrRestrictedInformation: True
DiagnosticsSuppress: False
DiagnosticsMessage: Message not shown because the NavBaseException(string, Exception, bool) constructor was used.
MessageWithoutPrivateInformation: Message not shown because the NavBaseException(string, Exception, bool) constructor was used.
SuppressExceptionCreatedEvent: False
FatalityScope: None
ErrorLevel: Error
Message:
The following SQL error was unexpected:
Invalid object name 'dbo.Country_Region$135f990f-8915-4a53-83fb-b8888b33e925'.
SQL statement:
SELECT TOP 1 0 FROM "dbo"."Country_Region$135f990f-8915-4a53-83fb-b8888b33e925" OPTION(OPTIMIZE FOR UNKNOWN)
StackTrace:
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ThrowNavSqlException(SqlExceptionAdapter exceptionAdapter, Boolean transactionNoLongerValid, String commandText, Boolean isLastExceptionARollbackCause, Boolean logExceptions, NavCancellationToken cancellationToken)
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.MapException(SqlExceptionAdapter exceptionAdapter, String commandText, Boolean isRollbackAction, Nullable`1 timeout, NavCancellationToken cancellationToken)
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.<>c__DisplayClass130_0`1.b__0()
at Microsoft.Dynamics.Nav.Types.NavThread.RunExternalAction[T](Func`1 action)
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.ExecuteFunctionWithTrace[T](EventTask task, Func`1 function, String commandText, SqlCommand sqlCommand, Boolean isAdoCommand, NavCancellationToken cancellationToken)
at Microsoft.Dynamics.Nav.Runtime.NavSqlCommand.ExecuteScalar(NavCancellationToken cancellationToken)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDdlCommands.GetDataExists(NavDatabase database, NCLMetaTable table, Int32 companyToken, NavAppTableContext tableContext, Action`2 filtersToAppend)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDdlCommands.PrepareOldTable(NavDatabase database, NavSqlTableAndChange tableAndChange, Int32 companyToken, SyncMode syncMode, Nullable`1 appSyncMode)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.SyncAllTables(IEnumerable`1 tableChanges, RebuildAction rebuildAction, Int32[] companyTokens, SynchronizationSetup syncSetup, Int32 syncStepNo, Int32 totalSteps)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.SynchronizeTableChanges(NavSession session, IEnumerable`1 tableChanges, Int32[] companyTokens, SynchronizationSetup syncSetup, Boolean isUpgradeTableSynchronization)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.PerformAppSync(NavSession session, IEnumerable`1 tableChangesToSynchronize, Int32[] companyTokens)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.SynchronizeTenantDatabaseForAppSyncInternal(NavSession session)
at Microsoft.Dynamics.Nav.Runtime.NavTenant.Microsoft.Dynamics.Nav.Runtime.ITenantSessionHandler.RunTenantActionInSystemSession(Action`2 action, Boolean throwExceptions, Boolean useCurrentCulture, Boolean allowAppsDisabledMode, LanguageSetting language)
at Microsoft.Dynamics.Nav.Runtime.NavSqlDatabaseSync.SynchronizeTenantDatabaseForAppSync(AppSyncContext appSyncContext)
at Microsoft.Dynamics.Nav.Runtime.NavAppSyncManagementTasks.SyncNavApp(SyncNavAppArguments args)
at Microsoft.Dynamics.Nav.Service.NSAdminService.<>c__DisplayClass142_0.b__0()
at Microsoft.Dynamics.Nav.Runtime.NavSqlTransientErrorHelper.<>c__DisplayClass2_0`1.b__0()
at Microsoft.Dynamics.Nav.Runtime.NavSqlTransientErrorHelper.InternalRetryOperationWithTransientError[T](Action operation, Int32 maxRetryCount, Int32 retryIntervalInSeconds, String callerName, String additionaInfo, Boolean expectedType)
at Microsoft.Dynamics.Nav.Runtime.NavSqlTransientErrorHelper.RetryOperationWithTransientError[T](Func`1 operation, Int32 maxRetryCount, Int32 retryIntervalInSeconds, String caller, String additionalContext)
at Microsoft.Dynamics.Nav.Service.NSAdminService.Microsoft.Dynamics.Nav.Types.ITenantDatabaseManagementService.SyncNavApp(SyncNavAppArguments syncNavAppArguments)
at SyncInvokeSyncNavApp(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.PushPopCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.VerifyAdminCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.TelemetryCombinator(Category telemetryCategory, Verbosity telemetryVerbosity, ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass6_0.b__0(ServiceOperation operation, NSServiceBase instance, MethodBase syncMethodLocal, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationTracer.TraceScopeCombinator(Category telemetryCategory, ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass10_0.b__0()
at Microsoft.Dynamics.Nav.Runtime.NavPerformanceCounterSetter.UpdatePerformanceCountersWithAverageServiceOperationDuration(Stopwatch stopWatch, Action action)
at Microsoft.Dynamics.Nav.Runtime.NavPerformanceCounterSetter.UpdatePerformanceCountersWithAverageServiceOperationAction(Action action, NavSession session)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.PerformanceCounterCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.InitClientTelemetryIdsCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.TlsClearCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.MessageRpc.Wrapper.Resume(Boolean& alreadyResumedNoLock)
at System.ServiceModel.Dispatcher.ThreadBehavior.ResumeProcessing(IResumeMessageRpc resume)
at Microsoft.Dynamics.Nav.Runtime.NavSynchronizationContext.<>c__DisplayClass1_0.b__0(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
HResult: -2146233088
----------------------------------
Type: System.Data.SqlClient.SqlException
ClientConnectionId: 25e5b21d-b406-4491-a138-054579bcc824
Class: 16
LineNumber: 1
Number: 208
Server: WIN10X64EN
State: 1
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: Invalid object name 'dbo.Country_Region$135f990f-8915-4a53-83fb-b8888b33e925'.
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.<>c__DisplayClass130_0`1.b__0()
HResult: -2146232060
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at Microsoft.Dynamics.Nav.Runtime.NavSqlConnection.<>c__DisplayClass130_0`1.b__0()

I have the same question (0)
  • raelhefn Profile Picture
    on at

    Hi,

    You could run the following SQL query against the Object Metadata Snapshot table, and see whether there are any empty IDs or Names.

    SELECT [Object ID], [Name], [Data Per Company] FROM [Object Metadata Snapshot] WHERE [Object Type] = 1

  • Isa Tahiri Profile Picture
    20 on at

    Here is what i see by running the following sql statement : 

    SELECT [Object ID], [Name], [Data Per Company] 
    FROM [Object Metadata Snapshot] 
    WHERE [Object Type] = 1 
    
    RESULT : 
    Object ID	Name	Data Per Company
    2000000006	Company	0
    2000000053	Access Control	0
    2000000067	User Default Style Sheet	0
    2000000068	Record Link	0
    2000000073	User Personalization	0
    2000000075	User Metadata	0
    2000000080	Page Data Personalization	0
    2000000083	Tenant Profile Setting	0
    2000000084	Tenant Profile Extension	0
    2000000086	Profile Configuration Symbols	0
    2000000095	API Webhook Subscription	0
    2000000096	API Webhook Notification	0
    2000000098	API Webhook Notification Aggr	0
    2000000107	Isolated Storage	0
    2000000110	Active Session	0
    2000000111	Session Event	0
    2000000114	Document Service	0
    2000000120	User	0
    2000000121	User Property	0
    2000000130	Device	0
    2000000146	Intelligent Cloud	0
    2000000152	NAV App Data Archive	0
    2000000153	NAV App Installed App	0
    2000000156	NAV App Published App	0
    2000000159	Data Sensitivity	0
    2000000165	Tenant Permission Set	0
    2000000166	Tenant Permission	0
    2000000168	Tenant Web Service	0
    2000000169	NAV App Tenant Add-In	0
    2000000173	Intelligent Cloud Status	0
    2000000175	Scheduled Task	0
    2000000177	Tenant Profile	0
    2000000183	Tenant Media Set	0
    2000000184	Tenant Media	0
    2000000185	Tenant Media Thumbnails	0
    2000000187	Tenant Profile Page Metadata	0
    2000000188	User Page Metadata	0
    2000000189	Tenant License State	0
    2000000194	Webhook Notification	0
    2000000196	Object Options	0
    2000000197	Token Cache	0
    2000000199	Webhook Subscription	0
    2000000200	NAV App Tenant Operation	0
    2000000201	NAV App Setting	0
    2000000205	Object Access Intent Override	0
    2000000210	Tenant Feature Key	0
    2000000213	Designed Query	0
    2000000214	Designed Query Caption	0
    2000000215	Designed Query Category	0
    2000000216	Designed Query Column	0
    2000000217	Designed Query Column Filter	0
    2000000218	Designed Query Data Item	0
    2000000219	Designed Query Filter	0
    2000000220	Designed Query Join	0
    2000000221	Designed Query Order By	0
    2000000222	Designed Query Permission	0
    2000000224	Designed Query Group	0
    2000000226	Query Navigation	0
    2000000228	Report Settings Override	0

    No empty ids or name.  

    and if we compare the two tables : they are the same : 

    pastedimage1609100511904v1.png

  • Isa Tahiri Profile Picture
    20 on at

    But the table dbo.object is empty. Is this normal at this stage of the upgrade ?

  • Isa Tahiri Profile Picture
    20 on at

    By the way this project is a migration project from NAV 2013R2 to Business Central Online.

    Many people are telling me that the path must be NAV2013R2-->NAV2018-->BC14--> BC17--> BC Online

    Until here I managed to do NAV2013R2-->NAV2018-->BC14 CU18

    According to MS site Migrating data from BC14 CU18 to BC Online should work. What is your opinion on that ? 

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    Hi I have recently done an upgrade and transferred data successfully to BC 17.1 from BC 14.18. Please check have followed the correct versions required using matrix given by microsoft.

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    If you need to migrate to v17.2 then you should first upgrade to Business Central v14.19 Please check your version.

    20201228_5F00_161443.jpg

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    And have you used toolkit objects properly ?

  • Isa Tahiri Profile Picture
    20 on at

    I'm not sure what you mean by toolkit. If you think about the TXT2AL, then yes I think so.

    IIn the doc, there is no other toolkit in the process of migration BC14 CU18 to BC 17.2

    Am I missing something ?

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    You are right, it is not required while migrating from BC 14 to 17. But it is required when you upgrade DB in previous versions.  see the link docs.microsoft.com/.../upgrading-the-data

    Here Pre-Req Point 4 and Task 7

  • Isa Tahiri Profile Picture
    20 on at

    You are right, the issue was coming from the previous, versions. My customer had some variable with french special characters. (very bad for the online version)

    It is my fist time migration to the cloud so I'm leaning on the fly :-)

    Then i also realized the my ids of customization where not exactly the same between the V14 and 17.2 cloud --> of course the data were not replicated.

    Now I migrated from NAV 2013R2 --> NAV 2018 --> BC 14.20 and to BC online via Cloud data migration and it worked.

    We have not finished the customer acceptance tests yes so I cannot guarantee that everything is ok but it is in better shape after managing these two issues.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans