NAV 2017 Upgrade Dependency issues

RoelofRoelof Member Posts: 377
I'm currently upgrading a NAV2015 database to NAV2017, build 10.0.14199.
The database has many custom Stored Procedures and views. During the Sync-NavTenant, after I imported the NAV2017 objectset with customizations, it couldn't compile one of the objects (Item table) due to a dependency error: 'Object xxxItem' cannot be renamed because the object participates in enforced dependencies.'
I basically had to delete all related StoredProcedures,Views and functions before I actually could compile the object.
This is obviously not something I'm waiting for in an upgrade. Is there a way to overcome this problem or does anyone else has similar experiences?
Roelof de Jonghttp://www.wye.com

Comments

  • vremeni4vremeni4 Member Posts: 323
    Hi

    You can run this SQL script to find the dependencies
    select o.name as ObjName, r.name as ReferencedObj
    from sys.sql_dependencies d
    join sys.objects o on o.object_id=d.object_id
    join sys.objects r on r.object_id=d.referenced_major_id
    where d.class=1
    AND r.name = 'Object'
    

    In general you do not need to delete the objects you only need to remove dependency.
    Be aware that by "enforced dependencies", it means Schema binding, so you'll have to look specifically for that.

    I hope this helps.
  • RoelofRoelof Member Posts: 377
    Thanks.
    I ran the query successfully but it didn't show anything. However when I go to the Item table->right mouse click->Dependencies, I'm getting a list of views, stored procedures with dependencies.
    How would I run your query specifically for the Item table?
    Roelof de Jonghttp://www.wye.com
  • vremeni4vremeni4 Member Posts: 323
    Hi
    select o.name as ObjName, r.name as ReferencedObj
    from sys.sql_dependencies d
    join sys.objects o on o.object_id=d.object_id
    join sys.objects r on r.object_id=d.referenced_major_id
    where d.class=1 
    AND r.name = 'CRONUS International Ltd_$Item'
    order by r.name
    
    or you can run it for all objects in the database
    select o.name as ObjName, r.name as ReferencedObj
    from sys.sql_dependencies d
    join sys.objects o on o.object_id=d.object_id
    join sys.objects r on r.object_id=d.referenced_major_id
    where d.class=1
    order by r.name
Sign In or Register to comment.