Unable to rename company in Navision.

David_Singleton
Member Posts: 5,479
Microsoft Dynamics NAV
The following SQL Server error(s) occurred while accessing the G/L Entry table:
15336,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]Object '"Playground"."dbo"."CompanyName$G_L Entry"' cannot be renamed because the object participates in enforced dependencies.
SQL:
{CALL [sp_rename](?, ?, ?)}
OK
I get the above error.
Does this mean someone has set up some constraint directly in SQL.
I am trying to rename "CompanyName" to Playground.
David Singleton
0
Comments
-
Sure looks like it!
Check the table in Management Studio and please let us know.0 -
Check Alter Database, Integration tab, is 'Maintain Relationships' turned on? By default, only 'convert identifiers' is turned on on that tab.0
-
DenSter wrote:Check Alter Database, Integration tab, is 'Maintain Relationships' turned on? By default, only 'convert identifiers' is turned on on that tab.
Thanks Daniel,
just looking in detail, I can see that someone seems to have "accidentally" imported the job objects from 4.0 into a 5.00 database. My guess is they were trying to bring in the old Job Scheduler and brought in too many objects. So there are lots of links now to non existent objects. So who ever did this probably just did a quick fix to make it work and mysteriously forgot to tell anyone what they did.
](*,)
Can't see any way to delete the old objects, so I will need to go in one by one and fix them to switch on maintain relationships.David Singleton0 -
Try this:
o Save the NAV table object mentioned in the error message
o Open the mentioned table object in Object Designer and disable SIFT Maintence flags
o Save and compile
o In SSMS open the Views section for the database and delete any views that remain for this table
o Re-import the original NAV table objectThere are no bugs - only undocumented features.0 -
I know this an old thread, but I'll just say thanks a lot. :thumbsup:
Your suggestion solved my issues with a 2009R2 database, which apparently had an orphan VSIFT index in the Value Entry table in 3 out of 4 companies.Regards
Peter0 -
Same here. Two orphaned visfts. We were able to pinpoint them in SQL Server and deleted them via SSMS.0
-
Try this:
o Save the NAV table object mentioned in the error message
o Open the mentioned table object in Object Designer and disable SIFT Maintence flags
o Save and compile
o In SSMS open the Views section for the database and delete any views that remain for this table
o Re-import the original NAV table object"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
On each index, there is a MaintainSIFTIndex property, default=Yes. NAV creates indexed views when you change the property from No to Yes and save the table (and synchronize schema in newer versions) - but since the default is yes in order to be able to do so you must first change the MaintainSIFTIndex property to No and also save the table (and synchronize schema).
Alternatively, you can change the order of indexes by inserting some dummy index with SIFT field on it right after the PK. If you save table all indexes and all SIFT views will be dropped and rebuild
Sometimes if an index or indexed view has been removed saving a table with an index with MaintainSIFTIndex set to No is impossible as NAV throws an error (show SQL's missing object error). In such a case the missing indexed view must be recreated outside NAV - but it does not have to match the original. NAV does not check the definition and as long as the name will be exactly as required the view can be based on a very simple statement like SELECT 0 as Col1. As far as I remember the dummy view does not even have to have an index on it,
I am not aware of any other methods to get NAV to re-create indexed views.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Works. Thanks a lot.
Btw, just in case somebody faces the same issue. If the VSIFTs are missing and you try to restore a navdata backup then from NAV perspective the table definition is not equal to your source database although the exact same object is imported."Money is likewise the greatest chance and the greatest scourge of mankind."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