Error in Sync-NAVTenant

weneed
Member Posts: 82
I am updating a version from NAV2015 to BC22 so I'm performing the first step that upgrades to version BC14.
When execute Sync-NAVTenant -ServerInstance DemoInstance system return this error:
Sync-NAVTenant : The following SQL error was unexpected:
String or binary data would be truncated.
The statement has been terminated.
At line:1 char:1
+ Sync-NAVTenant -ServerInstance DemoInstance
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Sync-NAVTenant], NavCommandException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$DemoInstance,Microsoft.Dynamics.Nav.Management.Cmdlets.SyncNavTenant
In the event log find more details:
Message:
The following SQL error was unexpected:
String or binary data would be truncated.
The statement has been terminated.
SQL statement:
ALTER TABLE dbo."COMPANY_DEMO$SOTTOSCRITTORI" ALTER COLUMN "Nr_ Rapporto" NVARCHAR(20) COLLATE Latin1_General_100_CI_AS NOT NULL;
In this table, there is a field whose size has been reduced from 20 to 10 characters but this has been handled in the upgrade codeunit:
DataUpgradeMgt.SetTableSyncSetup(DATABASE::"SOTTOSCRITTORI",0,TableSynchSetup.Mode::Force);
Why then am I getting this error that should instead be handled by the statement in the upgrade codeunit?
If I remove the statement from the upgrade codeunit, the displayed error is different (as expected):
Table: 50000, SOTTOSCRITTORI
Field: 10, "Nr_ Rapporto": Length reduced
When execute Sync-NAVTenant -ServerInstance DemoInstance system return this error:
Sync-NAVTenant : The following SQL error was unexpected:
String or binary data would be truncated.
The statement has been terminated.
At line:1 char:1
+ Sync-NAVTenant -ServerInstance DemoInstance
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Sync-NAVTenant], NavCommandException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$DemoInstance,Microsoft.Dynamics.Nav.Management.Cmdlets.SyncNavTenant
In the event log find more details:
Message:
The following SQL error was unexpected:
String or binary data would be truncated.
The statement has been terminated.
SQL statement:
ALTER TABLE dbo."COMPANY_DEMO$SOTTOSCRITTORI" ALTER COLUMN "Nr_ Rapporto" NVARCHAR(20) COLLATE Latin1_General_100_CI_AS NOT NULL;
In this table, there is a field whose size has been reduced from 20 to 10 characters but this has been handled in the upgrade codeunit:
DataUpgradeMgt.SetTableSyncSetup(DATABASE::"SOTTOSCRITTORI",0,TableSynchSetup.Mode::Force);
Why then am I getting this error that should instead be handled by the statement in the upgrade codeunit?
If I remove the statement from the upgrade codeunit, the displayed error is different (as expected):
Table: 50000, SOTTOSCRITTORI
Field: 10, "Nr_ Rapporto": Length reduced
0
Answers
-
Which BC14 CU do you use? Is the upgrade codeunit declared correctly? If nothing helps I would recommend to extend the field and reduce it afterwards with forcing.0
-
I would guess you get that error because the column (or even some other column in that table contains invalid UCS-2 or UTF-16 data (whichever your database is using).
I am not enuogh of an SQL expert to know how to check for this and much less how to correct it.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions