Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Error Syntax error near "US" while upgrading data from NAV 2013 to NAV 2018 CU 5.

(1) ShareShare
ReportReport
Posted on by 85

Hello All,

I am getting below Error "Incorrect syntax near 'US'" during Data Upgrade: Step: Sync Schema with Validation.

Sync-NAVTenant –ServerInstance nav2018_cu2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Sync-NAVTenant], NavCommandException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$nav2018_cu2,Microsoft.Dynamics.Nav.Management.Cmdlets
.SyncNavTenant

__________________________

Log from Event Viewer :

--------------------------

Server instance: nav2018_cu2
Tenant ID: <ii>default</ii>
<ii>Session type: UnknownClient
Session ID: 5
User: ''
Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavSqlException
ErrorNumber: 102
SuppressMessage: False
DiagnosticsSuppress: False
SuppressExceptionCreatedEvent: False
FatalityScope: None

<ii>The following SQL error was unexpected:
Incorrect syntax near 'US'.
SQL statement:
DECLARE @StatisticsToDrop NVARCHAR(MAX);
SELECT @StatisticsToDrop = COALESCE(@StatisticsToDrop +', ', '') + '[Comapny_Name$UPG Job].'+ s.name
FROM sys.stats AS s
INNER JOIN sys.stats_columns AS sc ON (s.stats_id = sc.stats_id AND sc.object_id = s.object_id)
INNER JOIN sys.all_columns AS c ON (c.column_id = sc.column_id AND c.object_id = s.object_id)
WHERE s.object_id = OBJECT_ID('Comapny_Name$UPG Job')
AND (c.name = 'Search Description' OR 
c.name = 'Description' OR 
c.name = 'Description 2' OR 
c.name = 'Bill-to Customer No_' OR 
c.name = 'Creation Date' OR 
c.name = 'Starting Date' OR 
c.name = 'Ending Date' OR 
c.name = 'Status' OR 
c.name = 'Person Responsible' OR 
c.name = 'Global Dimension 1 Code' OR 
c.name = 'Global Dimension 2 Code' OR 
c.name = 'Job Posting Group' OR 
c.name = 'Blocked' OR 
c.name = 'Last Date Modified' OR 
c.name = 'Customer Disc_ Group' OR 
c.name = 'Customer Price Group' OR 
c.name = 'Language Code' OR 
c.name = 'Picture' OR 
c.name = 'Bill-to Name' OR 
c.name = 'Bill-to Address' OR 
c.name = 'Bill-to Address 2' OR 
c.name = 'Bill-to City' OR 
c.name = 'Bill-to County' OR 
c.name = 'Bill-to Post Code' OR 
c.name = 'No_ Series' OR 
c.name = 'Bill-to Country_Region Code' OR 
c.name = 'Bill-to Name 2' OR 
c.name = 'No Del' )

IF @@ROWCOUNT > 0 BEGIN
SET @StatisticsToDrop = CONCAT('drop statistics ', @StatisticsToDrop)
EXECUTE sp_executesql @StatisticsToDrop
END

Thanks in advance.


Regards,

Murari Jangid

*This post is locked for comments

  • Murari Jangid Profile Picture
    85 on at
    RE: Error Syntax error near "US" while upgrading data from NAV 2013 to NAV 2018 CU 5.

    Thanks a lot.

    It worked :)

  • Verified answer
    Suraj M Patel Profile Picture
    332 on at
    RE: Error Syntax error near "US" while upgrading data from NAV 2013 to NAV 2018 CU 5.

    Hello Murari,

    Try Sync With Validation after Renaming your Company name by Removing US along with any Numerical Digits from it.

    Thanks,

    Suraj

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans