locked
Finding dependencies of an Entity in MS Dynamics CRM using SQL query RRS feed

  • Question

  • Hi All,

    Is there a way to find the dependencies of an entity using a SQL query. I'd like to query all the web resources, plugins and workflows associated with an entity. They are independently stored in webresourcebase , pluginassemblybase and workflowbase but I don't see any reference to the entity in these tables. Please advice. Thanks.

    Wednesday, January 6, 2016 9:32 PM

Answers

  • Hello,

    The easiest way to get correct SQL script is to use CRM functionality. I believe you use CRM On-Premise so SQL server is available. Try following:

    1. Open CRM.

    2. Open some solution.

    3. Select some component.

    4. Open SQL Server and run SQL profiler.

    5. In solution click "Show Dependencies".

    6. Get and analyze required SQL script from SQL Profiler.


    Dynamics CRM MVP
    My blog

    • Marked as answer by AJ15 Thursday, January 7, 2016 6:53 PM
    Thursday, January 7, 2016 7:12 AM
    Moderator

All replies

  • Hello,

    The easiest way to get correct SQL script is to use CRM functionality. I believe you use CRM On-Premise so SQL server is available. Try following:

    1. Open CRM.

    2. Open some solution.

    3. Select some component.

    4. Open SQL Server and run SQL profiler.

    5. In solution click "Show Dependencies".

    6. Get and analyze required SQL script from SQL Profiler.


    Dynamics CRM MVP
    My blog

    • Marked as answer by AJ15 Thursday, January 7, 2016 6:53 PM
    Thursday, January 7, 2016 7:12 AM
    Moderator
  • Hi,

    CRM internally uses p_RetrieveDependenciesForDelete stored procedure to get all the dependencies whenever you try to delete any crm  record.

    check in sql profiler as suggested by Andrii.

    Thanks,



    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Thanks and Regards,

    Mohammad Yusuf Ansari

    http://microxrm.blogspot.in


    Thursday, January 7, 2016 10:01 AM
  • Thanks Andrii for your reply. Was very helpful.
    Thursday, January 7, 2016 6:53 PM
  • Thanks Mohammed..
    Thursday, January 7, 2016 6:55 PM