Invalid object name 'XXXX.dbo.company$xxxxx'

rcverbeekrcverbeek Member Posts: 32
edited 2016-10-12 in NAV Three Tier
Hi,

We just ran into an interesting problem with one of our clients, on a Nav 2015 environment. In a newly created company the users received the following error message:
The following SQL error was unexpected
Invalid object name 'xxx.dbo.company$xxxxx'

We spent some time finding the problem and would like to explain what went wrong, so if you receive the same error you may find this post useful.

It appeared that the newly created company had a trailing space in its name, so 'company '. All the SQL tables had this space as well, however Dynamics Nav generates the SQL statement WITHOUT space. Hence the error. It couldn't find any of the Nav tables.

We ended up renaming the company via PS:

Rename-NAVCompany –ServerInstance 'DynamicsNAV90' -CompanyName 'Name with space' -NewCompanyName 'Name without space' -Verbose
Sign In or Register to comment.