locked
Access the SQL database directly - read only RRS feed

  • Question

  • Hi all,

    i would like to know if it is possible to access the CRM SQL database directly. What i want to do is to pull the case history out to a asp.net webpage.

    The process should be read only. All the data input will be done in CRM

    Thanks for the time.

    Cheers,

    Ayaka

     

    Wednesday, May 5, 2010 1:34 AM

Answers

  • Hi Ayaka,

    You should never query the CRM database directly.  Its best practice to access the data in CRM using Web Services.  The reason for this is if there is an update for CRM and the schema changes, your custom ASP .NET page could break.  Using web services will avoid this situation from happening.

    If you're unfamiliar with web services or how to use them then please visit the following link http://msdn.microsoft.com/en-us/library/bb928396.aspx to help get you started.

    Regards,

    Matt

    • Proposed as answer by MattTan Wednesday, May 5, 2010 2:07 AM
    • Marked as answer by Donna EdwardsMVP Friday, May 7, 2010 2:59 PM
    Wednesday, May 5, 2010 2:06 AM
  • Querying CRM using SQL can be accomplished (in a supported manner) by querying the 'filtered' views. - (e.g. filteredContact, filteredAccount, etc.)

    The user querying those views must be a CRM user, because the filtered views return the data via the security context of the user.

    Ensure that you do not inadvertantly create locks / impact performance by the queries used.

    Scott.


    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Wednesday, May 5, 2010 2:31 AM
    Moderator

All replies

  • Hi Ayaka,

    You should never query the CRM database directly.  Its best practice to access the data in CRM using Web Services.  The reason for this is if there is an update for CRM and the schema changes, your custom ASP .NET page could break.  Using web services will avoid this situation from happening.

    If you're unfamiliar with web services or how to use them then please visit the following link http://msdn.microsoft.com/en-us/library/bb928396.aspx to help get you started.

    Regards,

    Matt

    • Proposed as answer by MattTan Wednesday, May 5, 2010 2:07 AM
    • Marked as answer by Donna EdwardsMVP Friday, May 7, 2010 2:59 PM
    Wednesday, May 5, 2010 2:06 AM
  • Querying CRM using SQL can be accomplished (in a supported manner) by querying the 'filtered' views. - (e.g. filteredContact, filteredAccount, etc.)

    The user querying those views must be a CRM user, because the filtered views return the data via the security context of the user.

    Ensure that you do not inadvertantly create locks / impact performance by the queries used.

    Scott.


    Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell
    Wednesday, May 5, 2010 2:31 AM
    Moderator